I have bought a hosting package from a provider that gives 500MB space with Unlimited Transfer with CGI/Perl hosting, the main reason i bought it is to host a couple of CGI applications on it. Two CGI applications are very heavy duty applications and contains over 20 modules files per application plus many .pl files.
Is there any limitations on using Perl Excessivly? I mean i am only going to be using it for the perl applications, so does anyone think there will be any problems of any sort?
Any comments will be appreciated.
Cheers
Linda
Bandwidth and server usage are somewhat different animals - your scripts will depend on the CPU and memory utilization, while bandwidth is the amount of data being transferred to and from users.
Can anyone tell me what sort of scripting tasks is most likely to use up tooo much system resource, i.e. LWP, Opening Text Files, etc..
Any suggestions would be highly appreciated.
Cheers
Linda
One of the canonical examples involves opening a text file. Depending on what you are doing with the file, you often have the option of either reading the whole file into memory and then processing it or reading and processing line by line. Often, when people read the whole thing into memory, they will then do things with the file that effectively create two or three coppies of the data in memory. They may even throw most of it away. There are enough problems with this approach that it is generally reccomended against, but it's easy to code so people certainly do it. I've even been guilty myself, even when I knew the file was going to be over 50 MB. (I've re-written that one since.) On the other hand, you could read and process the file a line or two at a time. In a rare few cases this doesn't work, but usually it does, and saves a lot of RAM. If you're using regular expressions, it saves even more.
In general, working with large sets of data is likely to take longer, use more RAM, etc. Nested loops are also something to watch out for, but they aren't always excessive and sometime's they're just really the only way. Doing several DB queries per page can also get a bit expensive. If you search the web for "computational complexity" you ought to be able to turn up some information on how to tell roughly how much load a script will generate, but you'll need at least a basic knowledge of programming to understand and apply the information.