Running a PHP script with nice

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
kevin7654
Forum Newbie
Posts: 19
Joined: Sat Feb 18, 2006 2:38 pm

Running a PHP script with nice

Post by kevin7654 »

Hello,

I'm trying to run a php script in the background on my webserver using nice. The reason behind this is that the script takes 30+ minutes to run (it deals heavily with photos) and I don't want it to slow the webserver down while its running. Does anyone know how to do this? I currently run the script through cronjob using "nice wget http://www.myphpscript.com".

Any suggestions?

Thanks,
Kevin
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Doesn't nice expect an -n option??? (man nice for more information).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If you have alternate access to the domain, like FTP, I'd use that. If it isn't your domain, I hope you have permission to take the information ..and pictures.
kevin7654
Forum Newbie
Posts: 19
Joined: Sat Feb 18, 2006 2:38 pm

Post by kevin7654 »

Yes I didn't copy the exact nice argument, I do provide it with the value 10, but it makes the wget call at priority 10 but then the httpd service responds and starts a process with priority 0

the pictures are already on my webserver and I do have permission for all of them.

thanks for the help
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If the files are already on your server, why copy them via a full remote request?
kevin7654
Forum Newbie
Posts: 19
Joined: Sat Feb 18, 2006 2:38 pm

Post by kevin7654 »

Sorry I guess I didn't do a good job of explaining myself. All of the files are on my server, there is no remote request. It is just manipulating the pictures.
Post Reply