Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Number of requests

74 views
Skip to first unread message

Yo

unread,
Nov 2, 2010, 6:49:49 AM11/2/10
to
Hello,

I am looking for a way to know the number of requests currently running
on my mySQL database.

I found the SHOW FULL PROCESSLIST command displays the list of current
request, but I am looking for a SQL command giving the number of
requests, not the list of the requests.

Is it possible to do in SQL ? Thank you.


"Álvaro G. Vicario"

unread,
Nov 2, 2010, 7:07:02 AM11/2/10
to

If you have the appropriate permissions:

select count(*)
from information_schema.processlist

--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Yo

unread,
Nov 2, 2010, 7:14:50 AM11/2/10
to
Il se trouve que "Álvaro G. Vicario" a formulé :

> El 02/11/2010 11:49, Yo escribió/wrote:
>> Hello,
>>
>> I am looking for a way to know the number of requests currently running
>> on my mySQL database.
>>
>> I found the SHOW FULL PROCESSLIST command displays the list of current
>> request, but I am looking for a SQL command giving the number of
>> requests, not the list of the requests.
>>
>> Is it possible to do in SQL ? Thank you.
>
> If you have the appropriate permissions:
>
> select count(*)
> from information_schema.processlist

Works perfectly, thank you !


Axel Schwenke

unread,
Nov 2, 2010, 7:16:53 AM11/2/10
to
Yo <nomail@nomail_invalid.net> wrote:
>
> I am looking for a way to know the number of requests currently running
> on my mySQL database.
>
> I found the SHOW FULL PROCESSLIST command displays the list of current
> request, but I am looking for a SQL command giving the number of
> requests, not the list of the requests.

There are counters per request type, i.e. COM_UPDATE counts the number
of processed UPDATE statements. Global counters start with 0 when the
server starts. Session counters can be cleared explicitly. RTFM!

> Is it possible to do in SQL ? Thank you.

Counters can be read with SHOW GLOBAL STATUS.

http://dev.mysql.com/doc/refman/5.1/en/show-status.html


XL

thoughtcrimes

unread,
Nov 3, 2010, 12:53:21 PM11/3/10
to
On Nov 2, 7:07 am, "Álvaro G. Vicario"

<alvaro.NOSPAMTH...@demogracia.com.invalid> wrote:
> El 02/11/2010 11:49, Yo escribió/wrote:
>
> > Hello,
>
> > I am looking for a way to know the number of requests currently running
> > on my mySQL database.
>
> > I found the SHOW FULL PROCESSLIST command displays the list of current
> > request, but I am looking for a SQL command giving the number of
> > requests, not the list of the requests.
>
> > Is it possible to do in SQL ? Thank you.
>
> If you have the appropriate permissions:
>
> select count(*)
> from information_schema.processlist
>
> --
> --http://alvaro.es- Álvaro G. Vicario - Burgos, Spain

> -- Mi sitio sobre programación web:http://borrame.com
> -- Mi web de humor satinado:http://www.demogracia.com
> --

as Alvaro said, select count(*) from information_schema.processlist
will give you the number of connections.

If you are looking for only connections that are active, you can do
select count(*) from information_schema.processlist where state != ''

0 new messages