Initial request for the page too slow

My plone site suddently started to go very slow, but only on the first initial request for the page(the html). It switches between slow and fast at will, and sometimes may take over 5 minutes to load a single page, on the next f5, it takes 2 seconds. What could be causing this? I'm out of ideas.

Did you check the size and utilization of your ZODB cache (/Control_Panel)?
Do you see some lack of RAM resources on your server? Swapping?

You might use profiling to find out for what time is being spent.

For Zope 2 (Plone up to 5.1), you could use Product.ZopeProfiler, for Zope 4 (Plone 5.2+) dm.zope.profile.

Provide us some background, like (off head):

  • Plone Version?
  • Addons?
  • Database size?
  • Storage configuration? (Single/ZEO, RelStorage)
  • On which system?
  • How is hardware, disk IO, RAM?
  • Heavy DIazo usage?
  • Slow only after startup or also after a while idling?
  • Customized start page/ lots of objects to load?
  • Custom addons?

What else do you consider important?

ok, i'm gonna try awnser as much as i know.

  • Plone Version?
    Plone 5.0.6rc1 (5016)
    CMF 2.2.10
    Zope 2.13.24
    Python 2.7.12 (default, Oct 22 2016, 00:33:06) [GCC 4.9.2]
    PIL 3.3.1 (Pillow)

  • Addons?
    only the plone.restapi and the session refresher.

  • Database size?
    We don't use a database for the site itself, we send all the data to be stored on another system via requests. The only storage on the zeo server is the configurations on the plone itself, and we run a small redis server to store one single json with some data about configurations of custom features

  • Storage configuration? (Single/ZEO, RelStorage)
    I'm not sure, but we store the configurations on the zeo server itself if that's what you are asking

  • On which system?
    Not sure about the question, you mean the operational system of the VM? linux.

  • How is hardware, disk IO, RAM?
    Hardware is fine, the zeo logs are fine, the application logs are fine. All the external requests are also working well.

  • Heavy DIazo usage?
    less than 100 lines

  • Slow only after startup or also after a while idling?
    Slow on every page load, regardless of other factors. It also gets better with less people acessing it, but the amount of people using it those days is completely normal and not even close to be above avarage. It's very slow (4~5 minutes) with 500 users while it was running with 3k users before (december/2020) without problem.

  • Customized start page/ lots of objects to load?
    Yeah, but those don't take a long time to load.

  • Custom addons?
    Yes, two.

Putting it simple, it doesn't takes long to load anything, except the html itself. on the network tab, it only shows one request 'pending', while the log of the app doesn't move, standing idle for a couple of minutes on the request of the page itself, then if suddenly resolves and the log moves, when that happens, all the rest of the requests start and finish quickly.

The hardware is running fine on everything, it was the first thing we checked.

Is there nothing in front? Apache for example ? Is it possible that it (sometimes) restarts ?

Only the nginx, but I get the problem even on localhost.

If you run it in foreground, something change? Are you sure ZODB is not set readonly, for example? Does changing timeouts help?

For me this is the easiest thing to do given that you are still using Plone 5.0.6rc1

In your buildout add:

zope-conf-additional +=
    publisher-profile-file ${buildout:directory}/var/profile.dat

Then visit http://localhost:8080/Control_Panel/DebugInfo/manage_profile

1 Like