Jump to content

Delayed website load due to long database connection?


Recommended Posts

My website, dragonmount.com, is slow to load. There's an initial long delay of about 6-12 seconds, and then the entire site rushes and loads quickly. This has been driving me crazy because I can't figure out where the delay is coming from.

  • The IPS application is installed onto a local server. 
  • The MySQL database is installed on a different server.
  • The two servers (app + db) are connected to the same switch. Easy networking. Fast ping times. 

At this point, I wonder if the initial delay described above is due to the server making a request to the DB. Could that be it?  How do I track it down? Does IPS make a single, persistent connection or does it us a new db connection for every request?

Either way, the issue does not occur with the ACP. The ACP loads much faster. 

Ideas?

Link to comment
Share on other sites

  • 2 weeks later...

Do you by any chance have Cloudflare configured for this site, or tried it at one time?

It looks like the frontend does not resolve properly and it actually takes 7 seconds for the server to respond. Once it responds things looks very fast, but there is something going on that locks the request for a while before it can get the server to respond.

image.thumb.png.ed40312876a4ebf669c609fa6f19f3b2.png

 

 

Link to comment
Share on other sites

  • 3 weeks later...

Hi @Jimi Wikman: Thank you so much for your reply. I wasn't notified of it by email so I just saw it now.

Yes, I do have Cloudflare. I would love if the answer to this problem was that CF wasn't configured properly. Any advice? I've been banging my head against a wall for months over this. I don't know where that 7-second delay is coming from.

Even if I put the Cloudflare DNS into bypass mode, and also put it into "Development mode" (ie, bypass cache, etc), it still has the delay. 

Thoughts?

Link to comment
Share on other sites

There is something with the server that takes a very long time.

The dns and ssl resolve look fine, but then it takes the server ages to respond.

image.thumb.png.6df3f2534f6c3bccbb2ad5563b177ecc.png

image.thumb.png.9c6c70c4615084f7f9647c95b14095f3.png

So I think you need to do internal checks to see what happens after the server get the request.  I am guessing there is a latency in the resolve and also the database connection is probably slowing things up. Check the internal connectivity and make some tests to see just how fast things move after the initial request.

Link to comment
Share on other sites

13 hours ago, Jimi Wikman said:

So I think you need to do internal checks to see what happens after the server get the request.  I am guessing there is a latency in the resolve and also the database connection is probably slowing things up. Check the internal connectivity and make some tests to see just how fast things move after the initial request.

Thanks, Jimi, I appreciate your time and advice. My servers run on Antlse hardware, which is kinda cool, but yeah, I wonder if if's getting tripped up on name resolution or something else. Maybe my vhosts config is wonky or something.  Or maybe the server is just getting overwhelmed? The stats look good though so I dunno. 

Link to comment
Share on other sites

I've resolved the issue. You won't believe what it was.  

I upgraded to 4.6. Memcache is no longer supported so I disabled all server-side caching. Result: the website is incredibly faster. Like, not even kidding you, 50x faster. Memcache must not have been set up wrong or was otherwise messing things up. The site is blazing fast now. (I use Cloudflare for CDN caching, but even with that disabled, it's fast). 

Thanks for all the advice!   (cc @Jimi Wikman)

Link to comment
Share on other sites

On 6/18/2021 at 7:52 PM, jwdenzel said:

I've resolved the issue. You won't believe what it was.  

I upgraded to 4.6. Memcache is no longer supported so I disabled all server-side caching. Result: the website is incredibly faster. Like, not even kidding you, 50x faster. Memcache must not have been set up wrong or was otherwise messing things up. The site is blazing fast now. (I use Cloudflare for CDN caching, but even with that disabled, it's fast). 

Thanks for all the advice!   (cc @Jimi Wikman)

nice!

Glad you got that sorted 🙂

Link to comment
Share on other sites

  • 2 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...