Forum Moderators: coopster & phranque

Message Too Old, No Replies

Question about Excessive Perl Use

         

lindajames

11:17 pm on May 18, 2003 (gmt 0)

10+ Year Member



Hi,

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

rogerd

2:50 am on May 19, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Linda, there's no way to answer this question. Whether your scripts will get bogged down will depend on your usage as well as others on the shared server. One minor red flag is the "Unlimited Transfer" characteristic. You may end up sharing the server with clowns trying to stream video, host image galleries, etc.

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.

Schoolbag

4:38 pm on May 28, 2003 (gmt 0)

10+ Year Member



I was testing a free script once with no modules at all, it almost brought the server down. I would speak to your host and run a test of your scripts to see what weight they actually have on the server. What you may think is heavy duty may be nothing for their servers.

Fred

lindajames

11:46 pm on Jun 4, 2003 (gmt 0)

10+ Year Member



I've been told by many people that even a simple script can utilize alot of server resourses to such an extent that the host has no other option other than to suspend the site. Well, the script i am currently running has been running fine for me for nearly a year now but thats probably because its only accesses maybe once every 30minutes.

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

dingman

4:52 am on Jun 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I doubt anyone is going to be able to give you a really good handle on that. There are different kinds of load, and there are different ways of doing things in the script that will stress different resources on the server.

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.

Storyteller

6:40 am on Jun 5, 2003 (gmt 0)

10+ Year Member



Linda, first make sure you're using mod_perl-enabled Apache with CGI acceleration on. Otherwise it can be times slower than it should, depending on the application.

As to the excessive use, this should be discussed with the hosting provider. Some explicitly limit resource usage, but most don't.