Take the 2-minute tour ×
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

Hello Craft community,

My team and I have built a site for a client and it looks great. The site runs just fine in my developers local environment and we're all very happy. I have the site now set up on my preproduction Red Hat environment and when I access it there is about 30 seconds of latency, every single time. I cannot figure out where this latency happens, perhaps there is a configuration somewhere I am missing?

I can access images, js files, etc. without any issue - but once I hit a php file in the Craft environment, things are super slow.

I tried turning the devMode flag to false in the general configurations and that didn't seem to help.

This has nothing to do with my browser - I've tried a straight CURL to the URL and I see the same amount of lag. Perhaps there's some server-side caching I need to enable? Like I said - this is not just with my site, it was slow during the install as well as when I just access the admin tool to look at/change configurations. Please help!

share|improve this question
    
Have you any api calls that have hit their rate limit... that caught me out twice! –  Sean O'Grady Jul 16 at 13:06
    
Sean - what kind of API calls? I am just trying to hit my home page of my site of the landing page, and nothing. Even if I was hitting an API - I'm no where near a rate limit, I'm the only one hitting it! :) –  Shane Kaszyca Jul 17 at 19:48
    
I am also experiencing huge latency and 503 errors all of sudden and only on Craft CMS sites on my server. All other sites on the server appear to be responding normally. There's nothing that's changed on our end, but, suddenly all 3 Craft CMS sites are showing huge latency or 503 errors on both front-end and back-end. Has anyone had experience with this or found potential solutions? –  Brian Nov 3 at 2:32
    
Depends on if you are using PHP FPM, recently had an issue with nginx as a proxy to Apache but it was a PHP specific error, trying a PHP info page as well as a static html page and isolate if it's PHP or the Apache/nginx server. –  Jason McCallister Nov 3 at 3:46
    
I think Sean meant external APIs like Twitter, Instagram, etc. Check that permissions are correct on your preprod server. Enable devMode, how many queries is the page doing? Do you have open basedir restrictions in your php config? –  André Elvan Nov 3 at 7:09

2 Answers 2

up vote 5 down vote accepted

Could you upload a "non Craft" php-file, restart the server, and check if this file also loads slow? If it does, the server has probably some kind of an issue, and you should contact your hoster.

If not, try:

  • deleting the /craft/app/storage/runtime directory.
  • bumping up the php memory_limit.
  • contacting P&T support from the Dashboard widget. They love environmental issues (So I've heard... *cough*).
share|improve this answer
    
I did load an info.php to dump my environment information and it loads immediately without any issue from both the browser as well as a curl statement. I'll look into the other options. Right now my php memory is set to 128 MB - which I've read in the requirements is enough. I removed the runtime directory and that did not help either. I turned on slow query logging to see if anything would spit out - nothing shows up. Slow query threshold at 2 seconds. –  Shane Kaszyca Jul 17 at 19:47
    
Ok, it looks more and more like an environmental issues. You should contact P&T now ;) –  Victor In Jul 17 at 20:02

I've just ran into this myself this morning. It looks to be related to the SmartMaps plugin doing an IP > Geo lookup using an external service.

Specifically it looks like it's using this api :https://geoip.maxmind.com/geoip/v2.0/ which is hanging.

Disabling the plugin fixed my loading issues.

share|improve this answer
    
I also had CURL errors, not just related to SmartMap, but that did show up as one of the errors. –  Sean O'Grady Nov 3 at 13:12
    
Hey Joel and Sean, which version of Smart Map are you running? Some changes have been made recently to alleviate issues like this. –  Lindsey D Nov 3 at 15:24
    
I'm using 2.0.8 –  Sean O'Grady Nov 3 at 19:37
    
UPDATE: Several recent iterations of Smart Map have reduced the dependence on 3rd party services. As of version 2.0.12, the visitor geolocation feature has been made optional, and even disabled by default. For those users who still require geolocation of their website visitors, a subscription to MaxMind is highly recommended (instead of relying on the free, but unstable, FreeGeoIp.net). –  Lindsey D Nov 19 at 18:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.