Apache/Mysql: process runs at 100% after page is loaded

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-11-2004
Allan Rydberg
 
Posts: n/a
Default Apache/Mysql: process runs at 100% after page is loaded



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






  #2 (permalink)  
Old 02-11-2004
Davide Bianchi
 
Posts: n/a
Default Re: Apache/Mysql: process runs at 100% after page is loaded

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
|
  #3 (permalink)  
Old 02-11-2004
Allan Rydberg
 
Posts: n/a
Default Re: Apache/Mysql: process runs at 100% after page is loaded



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
>


  #4 (permalink)  
Old 02-11-2004
Allan Rydberg
 
Posts: n/a
Default Re: Apache/Mysql: process runs at 100% after page is loaded



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
>


  #5 (permalink)  
Old 02-11-2004
Davide Bianchi
 
Posts: n/a
Default Re: Apache/Mysql: process runs at 100% after page is loaded

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
|
|
  #6 (permalink)  
Old 02-11-2004
Allan Rydberg
 
Posts: n/a
Default Re: Apache/Mysql: process runs at 100% after page is loaded



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
>


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:44 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0