[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Mysql causes high server load-connection problem?



Terje Grefstad,
> I am trying to find out why my Cobalt Raq4i
> (512 Mb RAM) can not handle a mere 15000
> pageviews per day, with 10000 of these occouring
> in a 3 hour period.

Have you looked at the error logs?  You can turn on more extensive error
reporting in MySQL to pinpoint what queries are causing the problem.  Sounds
more like your queries could use further optimization, and/or php code is
poorly written.  Do you cache your results at all?

For example:
http://www.bettingadvice.com/showBnews.php?id=63

Can be generated once every hour, then cached to a temporary directory
somewhere.  That way the contents are pulled from a cached copy therefore
only served from the database only once an hour.  You could use a p166 to
serve a site like this if the program is written correctly.

If you click "View"->"Source" of the above page you will also see php (or
asp) code that is not being processed correctly.  The code is not be
processed by the interpreter.

<%
	session_start();
	session_register("varTopTips");
	session_register("varLatest");

%>

Do you realize that this is in the code?

The php manual has more than enough information about why you should use
persistent connections:
http://www.php.net/manual/en/features.persistent-connections.php