Two Laptop Bag*
The moose likes Servlets and the fly likes performance question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "performance question" Watch "performance question" New topic
Author

performance question

Steve Mutanson
Ranch Hand

Joined: Apr 15, 2003
Posts: 67
I am developing a servlet application. It is connected to the backend database and has lot of business logic needs to be handled as well.
Now, I found that, everytime when I come back on Monday morning and access the site, it takes significantly longer time ( times as long as normal) to get the page, then after that , any following up access to the other sites in the application takes much less time.
Does it have something to do with the fact that I don't access it over the weekend and some stuff is cleaned out, and then later on the system uses cached objects automatically ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Is there any chance that the server has been restarted over the weekend? If so, everything has to load up again upon first hit.
If this is the case, and Monday-morning performace is important to you, you can schedule a job to fire off in the early hours Monday morning that hits the page(s) so that everything is awake and ready when people start hitting it.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Mutanson
Ranch Hand

Joined: Apr 15, 2003
Posts: 67
Just want to add some more information for my scenario --- Our unix server is periodically shut down and rebooted. And it is scheduled every Sunday midnight. Does this contribute to what happened to me ?
Steve Mutanson
Ranch Hand

Joined: Apr 15, 2003
Posts: 67
Originally posted by Bear Bibeault:
Is there any chance that the server has been restarted over the weekend? If so, everything has to load up again upon first hit.
If this is the case, and Monday-morning performace is important to you, you can schedule a job to fire off in the early hours Monday morning that hits the page(s) so that everything is awake and ready when people start hitting it.
hth,
bear

Thanks bear. I sent out the follow-up post without knowing you have responded. I guess that does affect my MOnday morning page hitting performance. Technically could you suggest how I can automatically make some page hit after the rebooting ?
thanks,
Steve Mutanson
Ranch Hand

Joined: Apr 15, 2003
Posts: 67
Originally posted by Bear Bibeault:
Is there any chance that the server has been restarted over the weekend? If so, everything has to load up again upon first hit.
If this is the case, and Monday-morning performace is important to you, you can schedule a job to fire off in the early hours Monday morning that hits the page(s) so that everything is awake and ready when people start hitting it.
hth,
bear

Actually, I am still bit confused by my observation. We use Solaris Unix server, and use JRun for web component application. During the weekdays while the unix server is always on, occationally we shut down and reboot the JRun. But I find that this NEVER causes any performance problem as what I saw on Monday mornings. So, when unix server is on and I reboot JRun, why don't I see performance problem ?
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

It might depend on how much you use sessions in your app. JRun may persist the sessions between shutdown and restart, but might not manage to carry that through a OS restart.

Also, if it pools and maintains database connections, then again JRun may have some sneaky caching, and for sure, over a weekend, whether your box is getting booted or not, a db connection would time out and need to be re-established. This is db connection-pool related and/or driver related.

Also, JRun during it's life might grow to take 'owernship' of a certain number of TCP/IP connections. Where I once worked we had a leaking application that was made worse by the extremely heavy load it experienced. Long story short..Solaris would eventually "run out" of sockets and need to start queueing requests at the OS level. Now on a normally functioning app, perhaps it grows to a certain 'comfort zone' and on Monday morning you have to re-grow it.

That's a couple thoughts.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: performance question
 
Similar Threads
DB connection in webapplication.
possibility of getting user name from session inside getconnection method
Unable to access same database with two different application server
Java app on Tomcat return "Network Error (tcp_error)" error
JBoss compiling JSP