Weird response times

I'm working with Plone 4.0 on Ubuntu. (I know I should upgrade, but I'm working towards that...)

So I have a plone site that I have put onto a development server. I haven't set up reverse proxy with nginx yet. I am just using it as a test for now, so I don't need to do that yet. I start the server, pretty much like it is described in here

Now it works fine, so I stop the server and put in my own blobstorage and Data.fs files. This is a site that's been running on a different server under the same version of Plone. I start up the server and it works great.

However, when it first starts up, and I go to it in my browser, it takes maybe 2-3 minutes before responding.. I figured that's just the server starting up. Then I navigate around the site and it's fine, it's fast as any other site.

But if I go away for 5 minutes and come back to it and click another link, again it takes 2-3 minutes of spinning before responding with the page. If I click again on another page, then it is back to normal response times again.

It's like it went to sleep or something when I went away and had to wake up or something. (that's just the feeling I get). I tried it with the default install (blank new Plone site) and it was fine, it did not have this delay problem.

Any ideas what's going on here? Thanks,

Memory issues? Machine swapping?

not sure what machine swapping means...

I will say that the server it's on has 2 GB RAM and since it is just a test, I am the only one accessing it right now. So it's not a traffic issue...

Don't understand why it would be fast, then if I leave it alone for a while it becomes slow initially, then it will be fast again once it's woken up

Run „top“ and check how much swap space is allocated.

OK I ran top but I'm not sure what I'm supposed to be looking for.

When I reproduce the problem by accessing my site after a delay, top looks fine... I think the top item was python briefly at 7%, then it drops off and other things take over at 0.3% of the memory etc. The site still doesn't load for another 2 minutes or so... when it finally loads python goes back on top briefly at like 7% then falls off.

Again, I'm not really sure what I'm supposed to be looking for. Nothing seems to be taking up too much memory to me?

top - 18:30:30 up 2 days, 21:26, 2 users, load average: 0.00, 0.00, 0.00

Tasks: 113 total, 3 running, 110 sleeping, 0 stopped, 0 zombie

%Cpu(s): 0.7 us, 0.3 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st

KiB Mem : 2048188 total, 79076 free, 253328 used, 1715784 buff/cache

KiB Swap: 0 total, 0 free, 0 used. 1567548 avail Mem

Looks like your whole RAM is allocated

Is that good or bad? When I look at the performance, it looks fine:

This graph is from DigitalOcean and it covers the time when I accessed the site and it had a long wait time, as well as when I accessed it and it came back quickly... the memory usage seems to be a straight line... do you think I need to do anything different memory-wise?

that's normal if you have a small ZODB cache; read this:

also, note that good performance depends on many things; first you must do your homework and try to understand how Zope and ZODB work; read this also:

My suspicion is that your zodb-cache-size is set far too low. If it takes 2-3 minutes to load the first page, you probably need a lot of zodb objects for the initial rendering. You're staying fast while the operating system is keeping those in its cache, but when things are quiet that cache if getting de-allocated or is used for other file system items.