PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Sep 22, 2019 5:56 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: CLI script memory use
PostPosted: Mon May 31, 2010 7:56 am 
Offline
DevNet Evangelist

Joined: Tue Dec 21, 2004 6:00 pm
Posts: 6267
Location: Winnipeg
Is it possible to run a CLI PHP script with unlimited memory from PHP perspective but restrict how much processor/memory it consume at the system level?

The reason I ask, is because I have a script which needs to spider a massive HTML file (over 130 MB). The spidering program doesn't seem to work when I partition the massive file into smaller chunks and support isn't not responding to my request.

As a last ditch attempt I figure I can maybe set the memory to unlimited in PHP/MySQL but some how control the RAM the processes get and hopefully virtual memory will do the trick.

Cheers,
Alex


Top
 Profile  
 
PostPosted: Mon May 31, 2010 10:53 am 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine
ulimit -m
cpulimit


Top
 Profile  
 
PostPosted: Tue Jun 01, 2010 10:40 am 
Offline
DevNet Evangelist

Joined: Tue Dec 21, 2004 6:00 pm
Posts: 6267
Location: Winnipeg
Thanks you for that.

So from quickly reading the docs, I should login as a regular user, set the CPU limit with the-m option to limit memory consumption? Do I need to call these or added these in a bash script or can I call them in a one off setting (I don't really need them after I run this spider program)?

Secondly, while the php.ini for CLI is set to unlimited memory use (script was crashing due to memory shortage which setting to -1 fixed) will limiting the system memory cause the same affect or will it just take longer?

thanks Weirdan

Cheers,
Alex


Top
 Profile  
 
PostPosted: Tue Jun 01, 2010 1:18 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group