Forum Moderators: coopster & phranque

Message Too Old, No Replies

Massive Sized Scripts?

Have we reached the point of diminishing returns on memory/cpu?

         

Brett_Tabke

2:32 pm on Feb 13, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Today, I went a bit mental and loaded an entire set of cgi's into one program. (About 5 meg). Forget all that loading later and just put every last scrap of code into the cgi (about 40cgis went into 1 program). I then tweaked it with a command dispatch table to handle all the direct calls that would have previously been to a stand alone cgi.

Here is the part that is interesting - I saw no variation in system load. Memory did take a sizable hit and jumped from about 8gig to 12gig usage), but the server still had plenty of free mem and was not caching at all.

The system seems faster! Clearly, all the disk I/O to load cgi's was an issue with the individual cgis - even on an ssd drive server. The larger cgi is mostly staying cached in memory (*nix system).

Anyone had any experience with large scripts? Where is the breaking point for Perl? Is it all "resource" or system based? Does perl run into issues where optimization/speed/lookups/etc become an issue?

coopster

2:33 pm on Mar 6, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I cannot comment on Perl as I haven't developed that size of cgi in years now. However, I have run larger sized scripts in PHP without issue. I would advise you to compress them which loads in memory even faster and takes a smaller footprint once loaded. Any performance boost you can, take it.

I can tell you that loading libraries with multiple calls and/or functions will really take it's toll. Anybody that has used DOMPDF or WordPress and knows what they are talking about will justify that statement. Again, different languages being used here but still similar in their server execution.

Wish I could offer more insight amigo but I haven't cracked open my camel book for years now ;)
Anybody else that can comment from a Perl perspective?