Georgy N Joseph wrote:
I would really love to know where the actual bottleneck is. But how can I go finding that? All I can see from the access logs is a loooooong delay time when this action is being performed.
Its hard - even harder for someone not on your system - you need to investigate what exactly is going on when the application "hangs". So far all you have done is see the symptom (the stalling app), you need to know what else is going on on your infrastructure at that point in time.
All GUESSes obviously, but things like...
1) Whats happening on the app server ; is CPU maxed out, is memory maxed out (could be badly configured and the app is swapping memory in and out of disk for example).
2) Is the app rebuilding its cache because the system has restarted (what everyone assumed was the issue)
3) is your database "waking up"
- e.g. is the app running its "rebuild the menu structure" query against the database and the DB is just taking a while to execute it - run the same SQL in a DB session only, does that take a while?
4) is your network "waking up"
5) is something else happening at browser-level even (e.g. your browsers are doing something unexpected, perhaps your network is doing something unexpected first thing in the day (authorizing internet traffic or something like that))
6) is your database badly optimised - take the "build menu SQL" and run it first thing in the morning before you start to connect from the app - does it take a long time? why? ; this would be a sign of badly optimised DB (refresh its statistics) and could explain symptoms (subsequent executions of that SQL are cached but it "falls out" of the cache overnight)