This is a discussion on Apache/Mysql: process runs at 100% after page is loaded within the Apache Web Server forums, part of the Web Server and Related Forums category; has anyone seen something like this problem: on a php-page with many db-calls to mysql, the thread that ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
has anyone seen something like this problem: on a php-page with many db-calls to mysql, the thread that handled the request remains running at 100% cpu after the loading of the webpage has completed (and mysql_close() has been called). after a while, the thread goes back to normal load, but it still shows that it occupies lots of memory. the problem is that sometimes such a thread can get 'stuck' at 100% and slows down the following calls. i have to configs that show this behaviour: - apache 1.3.14 // PHP Version 4.0.4pl1 - Apache/1.3.29 // PHP/4.3.4 |
|
|||
|
Allan Rydberg <alrdbg@southtech.net> wrote:
> on a php-page with many db-calls to mysql, the thread that > handled the request remains running at 100% cpu after the On which system/os? It could be that the read require a lot of caching and the cache have to be freed. Maybe your query require some optimization. Davide -- | Trying to get Windows to run on the hardware that Linux typically runs | on is like pushing an elephant through a keyhole. -- Forbes | Magazine | |
|
|||
|
thought so too, but i found having it on two totally different setups: old: redhat 7.0 (guinness) php 4.0.4pl1 Apache/1.3.14 new: slackware 9.1.0 PHP 4.3.4 Apache/1.3.29 the only thing that might play a role is that the scripts that do it seem to use more memory than others. Davide Bianchi wrote: > Allan Rydberg <alrdbg@southtech.net> wrote: > >>on a php-page with many db-calls to mysql, the thread that >>handled the request remains running at 100% cpu after the > > > On which system/os? It could be that the read require a lot > of caching and the cache have to be freed. Maybe your query > require some optimization. > > Davide > |
|
|||
|
re2: i handle all queries the following way: mysql_open(...) mysql_query(select....) mysql_free_result() mysql_query(select....) mysql_free_result() ... mysql_query(insert...) // no free_result in these cases mysql_query(delete...) mysql_query(update...) mysql_close(); Davide Bianchi wrote: > Allan Rydberg <alrdbg@southtech.net> wrote: > >>on a php-page with many db-calls to mysql, the thread that >>handled the request remains running at 100% cpu after the > > > On which system/os? It could be that the read require a lot > of caching and the cache have to be freed. Maybe your query > require some optimization. > > Davide > |
|
|||
|
Allan Rydberg <alrdbg@southtech.net> wrote:
> mysql_open(...) > mysql_query(select....) > mysql_free_result() > mysql_query(select....) > mysql_free_result() That is pretty much what everybody does... it would be interesting to see what MySQL is doing during those queries... Davide -- | My Beowulf cluster will beat your Windows NT network any day. -- | wbogardt@gte.net | | |
|
|||
|
the point is not what it's doing during te queries, but AFTER. i found by now, that if i remove all insert/updates that i expected to be the cause for possible post-processing load, it still does it. so i'm stuck with just one select statement that retrieves about 90'000 id's from the db and stores it into an array. Davide Bianchi wrote: > Allan Rydberg <alrdbg@southtech.net> wrote: > >>mysql_open(...) >> mysql_query(select....) >> mysql_free_result() >> mysql_query(select....) >> mysql_free_result() > > > That is pretty much what everybody does... it would be interesting > to see what MySQL is doing during those queries... > > Davide > |