Forum Moderators: coopster
The problem I have is that when run the update script, it takes 25-30 seconds to run and no one can access the site during that time (97-98-99% CPU usage). Needless to say, that is too long and I lose people who don't like to wait as the browser hangs. I do this about 4-10 times a day so it ads up. I don't know if I'm losing the visitor will make me $100 or just waste bandwidth :), but I rather not lose anyone. I have talked to the programmer, paid extra and he tried 3 times already, but it's still too resource intensive. The DB schema, and several sorting options might be to blame.
Until this is solved permanently, and since this is just on my end, is it possible to tell the script to go slower (less CPU) so visitors have no problem accessing the the site as this is running? Waiting an extra 30 sec or a minute will not kill me.
any help would be greatly appreciated. I will, in a nice way, pass any info to my programer.
thanks
Otherwise, if you are running the script from shell (or if you could run it from shell), try this :
nice -n19 script_name
That will make it use less CPU cyles (and hence take longer to execute).
Marc
Now I got two more features to fix (speed wise) and I'm all set..
thanks again
Now my (back end) site is blazing fast. Something that took 10+ seconds to load, now loads in 0.3 seconds. Same hardware, same settings.
I do exactly the same thing - printing articles and homepage elements which generally don't get edited to a php include to save the DB accesses.
I don't quite follow what you mean by using "INDEX"? I'm not experiencing speed issues, but I am curious.
marcs - I've always thought that using NICE on a DB query is not a good idea, as the table locking will affect users accessing the site at the same time? In other works, better to get in and out of the job as fast as possible?
TJ
so I don't know ;).
I'm guessing MySQL keeps them in memory, no need to search the entire db each time.