For the time being, I am stuck with very slow server (K6-2 233Mhz, 160MB RAM) that is used as a small public webserver.
The dynamic site that I have created uses about 183 lines of perl, including about 6 (average) to 14 (max) mySQL requests per pageload.
A full pageload can take upto 2 seconds on the LAN. Presently, I cannot offload SQL to another computer, but the mySQL requests seem to take very little time.
What's taking the time is perl. Is there any way to speed up the execution? I have optimized this code and SQL requests the best I can, and gotten it down this far. Is there anything I can do to get better load times?
I'd suspect a very slow LAN, or maybe a 10 mb/sec interface card on the old machine. But you really can't tell where the slowdown occurs until you can objectively measure it. You don't tell us what server you're using nor what kind of statistics you're collecting. Nor do you tell us how big the queries are and so-on.
But obviously something is very wrong because 183 lines of Perl on a MySQL database should execute quite instantaneously. To start, execute the Perl program from a command-line and see how long it takes to run there.
Thanks for the reply, but it's a 100Mbit switched LAN.
I did mention some of the server specs before, it's not what I'd like to be running as a server, but I'm stuck with it for now:
160MB EDO RAM
30Gig 7200RPM Harddrive
Gentoo Linux 2.4.20-gentoo-r6
Here's the TIME statistics from running the scripts:
For the Header:
And the Footer:
Queries are tiny, so are the results... the longest one would be:
SELECT name,url,id FROM tree WHERE owner = '$myid';
The worst would be about 10 rows returned.
These scripts are being run through SSI, but I do not believe that is a factor in their tardiness (due to the command line run times). The content of a page is: [header SSI exec] content [footer SSI exec]. This is the easiest to maintain for me.
They dynamically build the navigation bars, breadcrumbs, news, and related links panels on the site. I thought of having them created as static pages, but it would be a lot of work to switch the system over, and a lot to maintain. The execution shouldn't take this long, and I was hoping to leave it running this way, for easy updates.