Jump to content

PHP Execution Time


farnoise

Recommended Posts

Hello All,

I have a PHP application which goes through my tables in MYSQL does some cleaning once in a while (Updating record, removing, adding, and etc..) its a PHP application that I wrote uses loop and foreach and gets executed by CroneJob on my server every 4 ~ 6 hours ( twice a day).

 

I haven't run the application for a long time but i am expecting my tables grow in rows in the near future. Here is some concerns that I have. I have set the execution time to 5 min, in my application I have a garbage collector and I make sure that every time a single row gets affected I free up the Variables, Sessions, and etc.. at the end of each process for the row then move to the next row and repeat... (so you see if I have 900 rows, it keeps executing few commands for each row frees up everything goes to the next row till the end stops).

 

Do you guys see any problem with this?? Again as my rows are growing I prob need to increase the Exc time since my app already running for about 3 ~ 4 minutes... Do you see any problem? Any alternatives ?? My server is Linux, Should I get into Linux commanding itself rather than PHP? (I have very little knowledge on Linux)

 

Oh, And if you think its ok as long as i free up memory in the function, is there a way that I force PHP time to MAX ?

 

Thanks so much, sorry for the long post

Link to comment
Share on other sites

Only a couple points

 

1) Make sure your executing it via the PHP-CLI interface rather than through the web server.  Running it through the web server just ties up a server thread and introduces additional complications.

2) You may want to add something to ensure you don't end up with multiple instances of the script running at the same time.  Especially if you start increasing the max execution time higher or disable it (setting it to 0 allows a script to run indefinitely).

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.