LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-08-2010, 03:11 AM   #1
dsksiva
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
Linux shell script .sh file consumes high memory


Hi Friends

I am having a php script which is used for bulk mailing. I run the script every minute through cron job.

I have mentioned the path of the php script in a .sh file and execute the .sh file through cron job.

Every time i run the script it utilizes high memory which results to server crash.

Please advice how to restrict memory usage for that process to be a minimum one or how to set priority to be low for that process so that it is executed when there is no high priority jobs, so that the server runs normally without going down when the script runs

Thanks
Siva.D
 
Old 09-08-2010, 03:24 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by dsksiva View Post
Hi Friends

I am having a php script which is used for bulk mailing. I run the script every minute through cron job.

I have mentioned the path of the php script in a .sh file and execute the .sh file through cron job.

Every time i run the script it utilizes high memory which results to server crash.

Please advice how to restrict memory usage for that process to be a minimum one or how to set priority to be low for that process so that it is executed when there is no high priority jobs, so that the server runs normally without going down when the script runs

Thanks
Siva.D
What actual you script do? what is the O/P of top commnad when script run via cron?

IMO run script every 1 minute is not good practice.

you can use nice to set priority.
 
Old 09-08-2010, 03:39 AM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by dsksiva View Post
Hi Friends

I am having a php script which is used for bulk mailing. I run the script every minute through cron job.

I have mentioned the path of the php script in a .sh file and execute the .sh file through cron job.

Every time i run the script it utilizes high memory which results to server crash.

Please advice how to restrict memory usage for that process to be a minimum one or how to set priority to be low for that process so that it is executed when there is no high priority jobs, so that the server runs normally without going down when the script runs

Thanks
Siva.D
If its just for bulk mailing and it crashes, there's high probability that your algorithm is not well design.show us your PHP code.
 
Old 09-09-2010, 07:12 AM   #4
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
If you get a progressive degradation before it crashes, I would examine whether the previous instance of the programme isn't over yet and so I would first look for this.

Are you closing the php script properly?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help for high level shell script kushkothari Programming 13 10-29-2008 11:16 PM
Help: rhel4->rhel5==>Matlab consumes more memory pronuncer Linux - Kernel 4 01-18-2008 05:40 PM
Mystery memory usage - what consumes my RAM? Z038 Linux - General 9 03-20-2006 10:17 PM
How to display how much memory resources consumes an app guarriman Linux - Newbie 1 12-17-2004 04:52 AM
How much Linux consumes memory? Eits0 Linux - General 5 09-02-2002 04:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration