GithubHelp home page GithubHelp logo

Comments (10)

saltcod avatar saltcod commented on September 27, 2024 2

For your last one @mubashir-zenkoders you'll want to move the createClient out of the useEffect.

from supabase.

mubashir-zenkoders avatar mubashir-zenkoders commented on September 27, 2024 1

Ok, let me try and debug it in depth.

Thank you so much. I really appreciate your help. 🎩

from supabase.

encima avatar encima commented on September 27, 2024 1

Ah, that one we may not be able to fully help with as it is more about NextJS behaviour. Without seeing all the code (no need to provide it!), you could:

from supabase.

mubashir-zenkoders avatar mubashir-zenkoders commented on September 27, 2024

My issue is exactly match to this one, but this issue is closed, that's why I created new one.

#937

from supabase.

encima avatar encima commented on September 27, 2024

This can certainly happen, especially when Supabase is "just postgres" under the hood.

What you can check:

  • Use the Logs Explorer and find out what queries are taking too long
  • Check the Query Performance page in the dashboard
  • Run explain analyze to understand the queries performance issues
  • Then check those queries with the index advisor
  • Use the CLI to run inspect commands against the DB
  • Check the metrics for your DB to see if the hardware is a bottleneck (i.e. if the CPU usage is at 100% for any of these periods)

Information we would need:

  • Are you querying from the same region as your project?
  • Have you optimised your database at all?
  • Is this from API calls or RPC or pure SQL?
  • Are you connecting directly or through the pooler (Supavisor)?

from supabase.

mubashir-zenkoders avatar mubashir-zenkoders commented on September 27, 2024

I am using Supabase js client to connect to the supabase.

supabase.from('someTable').select('*')

My database is new, just created a month ago, no production users, only my testing data is there.

My queries usually take a noticeably short amount of time (under 100ms) to respond to, but sometimes, ANY query, not just specific one, but any query randomly takes more than minute to respond. Mostly I am the only user.

This is from the supabase js client from nextjs project. I am not connected to db directly nor am I using RPC.

I have generated this report for you, as you can see usage not ver high or even high.

image

from supabase.

encima avatar encima commented on September 27, 2024

Thanks, this is a start, you would need to perform the other steps as well (index_advisor and inspect in the CLI to see index usage).

It could also be how the queries are made, do you have info from the Network panel in your browser to see the max time a query takes? Removing the application, you could also make the calls in the command line to try and narrow down the cause

from supabase.

encima avatar encima commented on September 27, 2024

Happy to help! Please feel free to post anything here if you want additional help, it will certainly help others and we can add any general advice into the docs.

from supabase.

mubashir-zenkoders avatar mubashir-zenkoders commented on September 27, 2024

I am also getting a weird issue since the beginning when I started to use the supabase.

Somehow, supabase JS client on the browser side does not makes req to the supabase at all, but using the same code on the server side it works simply fine.

For example, in nextjs v14, on client side, following code sometimes requests the supabase backend, and sometimes doesn't make any requests at all, resulting in loading forever.

I have verified it using the network tab.

This exact same code works on the server side in the API.

This happens sometimes, sometimes, just refreshing page also fixes the issue.

useEffect(()=>{
const supabase = createClient(...)

// when added console.logs, code does not process further this statement.
const {data, error} = await supabase.from('posts').select('*').limit(20)

// handle data and error

}, [])

from supabase.

Hallidayo avatar Hallidayo commented on September 27, 2024

Hi all, We’re going to close this one due to inactivity. Please feel free to reopen if you’re still having issues here or open a new issue.

from supabase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.