?
Solved

Server Kills my script

Posted on 2003-03-16
7
Medium Priority
?
155 Views
Last Modified: 2013-12-25
I have a script that uses the mime-lite perl module to send out mime email messages to a list of users.  The basic idea is this...

I have a file that lists all my user email addresses.  My mailer program is supposed to grab one of those addresses every 2 seconds and send one of them out.  My problem is that I am up over 50 users now, and the server seems to kill my script after about 10-15 emails.  I need this thing to stop killing my script, but am not sure how to go about it.  Does anyone have any ideas?
0
Comment
Question by:smauntz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 300 total points
ID: 8150039
I would suggest either using a mailing list handler like Mojomail (which I can personally recommend), or try using the Mail::Bulkmail module to send your mails.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 8150965
is it a CGI script called by the server by request of an URL?
Then the server's timeout for CGIs is most likely the reason.
Either change the timeout, or use a more sophisticated list of adresses, or use a specialised program, or start you script in background and let the CGI itself return immediately.
0
 

Author Comment

by:smauntz
ID: 8152808
I'm running the cgi script in the cgi-bin, but from a ssh command prompt.  I think the problem is related to the timeout for CGIs, but can't change that since it's a hosting company.

If by running something in the background, you mean something like this...

mailer &

I've tried that and it still gets killed.  It doesn't crash, I get a message saying my program had been killed.

I'll look into bulkmail, and mojomail since I don't have experience with them.

0
Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

 
LVL 51

Expert Comment

by:ahoffmann
ID: 8154049
in your CGI call a 2'nd program which does the time consuming work, like this:

   system("./timeconsuming.pl&");
0
 

Author Comment

by:smauntz
ID: 8154155
I tried ahoffman's advice, but the script that does the time consuming work is still automatically killed after approximately 20 secs of work.  The hosting plan I have right now is a virtual hosting plan, so I don't have a dedicated server.  They just told me today that I won't be able to run any cgi for more than 15-30 secs because they've set a limit on the server.  Any suggestions?  Would mojomail solve this kind of problem without having to go to a more expensive hosting plan?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 8158226
there is no way if the shell and/or OS is setup to give you only 15-30 secs per process.
You only can split you work in parts, and call them on behind another.
But it might be much simpler to get rid ogf the limit.
0
 

Author Comment

by:smauntz
ID: 8160109
I'm going to go ahead and accept Tintin's comment as the answer here...Thanks for the work though ahoffmann.  It looks like mojomail can do exactly what I need...it gives me the ability to break a sendmail job up into timed chunks.

Unfortunately, I can't get rid of the limit without going to a more expensive hosting plan (not an option for my client here), and I don't want to spend the time splitting the work into parts unless absolutely necessary.  It would turn a very simple mail script into a more complicated program with pipes and process forks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question