Sorry for bumping this topic up again. I've been too busy to the last few weeks to deliver a project till I almost forgot to return here to read all your feedbacks.
Thank you so much for all your replies. I am much more enlightened now.
Yes, the very first thing that I'd done is read the site stats provided by the hosting. (webalizer). Happy to find out that..
- Very few page count that caused the dreaded Servlet Error (some occured obviously during when I tested and debugged my newly uploaded jsp/codes).
- 99.9% of the pages are served correctly.
Still, I did proceed to iron out potential runaway codes by ensuring all the loops did exit properly .
If I'm not wrong, Resin in my hosting has been running for more than 12 days without restarting now.
Since I'll be expecting the site usage to triple by end of this year (as our marketing team is busy promoting it), I won't be sitting down so comfortably yet, which brings me to a new query:
Will the "load" be lessened if Resin "serve" less volume of HTML but accept more requests, compared to less request, but more volume of HTML?
Here's a scenario of a shoutbox I made:
CURRENT SCENARIO:
On first load, the shoutbox.jsp will display recent 100 "shouts" (or messages). All members can post a new message into the shoutbox. My javascript timer ensure the shoutbox is refreshed completely in client browser (yes.. a simple page reload of 100 latest shouts). This means the Resin in the server needs to "serve" out a HTML page containing 100 latest "shouts" at an interval I've set (currently its 10 seconds delay). Can't imagine how the server felt if 1000 members are active in that page.
WHAT I PLAN TO DO:
On first load, the shoutbox.jsp will display recent 100 shouts. A javascript timer (now set at 4 or 5 seconds interval) will call a fetch_new_shout.jsp (in hidden iframe) that fetches only the latest shouts . And with the magic of DOM and some javascripts, I will append these new entries back into the main shout listing.
Since the interval is shorter, the number of requests sent to the server will double or more compared to my current implementation. I'm afraid it's still going to tax the server, or worse, crash it.
please advise. Thanks again
WHAT I