randgen team mailing list archive
-
randgen team
-
Mailing list archive
-
Message #00099
Re: Reducing Perl CPU usage
Yes, this is true. However, the particular reason RQG takes a lot of CPU
time is different depending on the workload.
What you can do is use Devel::DProf to profile per usage and file a bug for
bernt containing the profile and the particular scenario.
Also, note that there may be a legitimate use for the high CPU -- for
example, you generate a lot of complex, yet invalid queries, and mysqld
rejects such queries outright. This way more cpu is spent in perl and less
in mysqld. Run RQG with --debug to see what is going on.
If your top output really shows one dozen mysqld processes running at the
same time, I do not think it is a realistic test even if the RQG was very
fast. Regardless of what type of machine/CPU you are having, unless you are
running single-threaded tests *and* have more than 1 core per mysqld, the
mysqlds are effectively starving each other. It is a better idea to run
shorter, more intensive tests on an idle machine than run longer tests on a
heavily loaded machine.
Philip Stoev
----- Original Message -----
From: "Roel Van de Paar" <roel.van.de.paar@xxxxxxxxxx>
To: <randgen@xxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, May 31, 2011 6:56 AM
Subject: [Randgen] Reducing Perl CPU usage
Hi All,
I am running 10 RQG threads on a quad core machine (using
combinations.pl --parallel=10).
Here is what I see in TOP:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3345 me 20 0 186m 14m 1860 R 38.0 0.2 3:20.73 perl
3282 me 20 0 186m 13m 1844 R 33.0 0.2 3:27.73 perl
3255 me 20 0 186m 14m 1848 R 27.4 0.2 3:22.05 perl
3314 me 20 0 270m 98m 1892 R 27.4 1.2 2:31.70 perl
3262 me 20 0 186m 13m 1848 R 27.1 0.2 3:24.75 perl
3268 me 20 0 200m 27m 1892 R 26.8 0.3 3:10.74 perl
3302 me 20 0 186m 13m 1848 R 25.4 0.2 2:50.10 perl
3290 me 20 0 241m 68m 1892 S 24.1 0.9 2:59.26 perl
3011 me 20 0 667m 46m 8244 S 21.5 0.6 1:43.02 mysqld
3187 me 20 0 987m 48m 8572 S 20.2 0.6 2:12.45 mysqld
2953 me 20 0 923m 52m 8496 S 19.2 0.7 2:15.93 mysqld
3006 me 20 0 667m 55m 8028 S 17.2 0.7 1:49.98 mysqld
2967 me 20 0 677m 53m 8132 S 16.6 0.7 1:35.39 mysqld
3011 me 20 0 667m 46m 8244 S 16.2 0.6 1:42.37 mysqld
3010 me 20 0 667m 46m 8140 S 15.9 0.6 1:30.93 mysqld
3017 me 20 0 677m 46m 8112 S 13.9 0.6 1:38.93 mysqld
3086 me 20 0 667m 47m 8052 S 10.3 0.6 1:23.74 mysqld
3012 me 20 0 1051m 55m 8708 S 8.6 0.7 0:52.48 mysqld
2949 me 20 0 1051m 55m 8884 S 7.6 0.7 0:29.10 mysqld
3327 me 20 0 186m 14m 1708 S 4.6 0.2 0:24.42 perl
3280 me 20 0 186m 12m 848 S 1.7 0.2 0:08.53 perl
3260 me 20 0 186m 12m 848 S 1.0 0.2 0:08.54 perl
3253 me 20 0 186m 12m 848 S 0.7 0.2 0:06.89 perl
3300 me 20 0 186m 12m 848 S 0.7 0.2 0:06.87 perl
3288 me 20 0 186m 13m 848 S 0.3 0.2 0:02.51 perl
3312 me 20 0 186m 13m 848 S 0.3 0.2 0:02.06 perl
3343 me 20 0 186m 13m 848 S 0.3 0.2 0:02.74 perl
As you can see, we're loosing a lot of CPU on Perl.
Maybe we can do things to tune it?
Two example threads:
http://www.webmasterworld.com/forum13/1575.htm
http://www.ccl4.org/~nick/P/Fast_Enough/
--
Kind regards,
God Bless,
Oracle <http://www.oracle.com>
Roel Van de Paar | Senior QA Engineer
Mobile: +61 0400 225 827 <tel:+61%200400%20225%20827>
Oracle MySQL Server QA
Oracle Australia | NSW 2440
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment
--------------------------------------------------------------------------------
Hi All,
I am running 10 RQG threads on a quad core machine (using
combinations.pl --parallel=10).
Here is what I see in TOP:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3345 me 20 0 186m 14m 1860 R 38.0 0.2 3:20.73 perl
3282 me 20 0 186m 13m 1844 R 33.0 0.2 3:27.73 perl
3255 me 20 0 186m 14m 1848 R 27.4 0.2 3:22.05 perl
3314 me 20 0 270m 98m 1892 R 27.4 1.2 2:31.70 perl
3262 me 20 0 186m 13m 1848 R 27.1 0.2 3:24.75 perl
3268 me 20 0 200m 27m 1892 R 26.8 0.3 3:10.74 perl
3302 me 20 0 186m 13m 1848 R 25.4 0.2 2:50.10 perl
3290 me 20 0 241m 68m 1892 S 24.1 0.9 2:59.26 perl
3011 me 20 0 667m 46m 8244 S 21.5 0.6 1:43.02 mysqld
3187 me 20 0 987m 48m 8572 S 20.2 0.6 2:12.45 mysqld
2953 me 20 0 923m 52m 8496 S 19.2 0.7 2:15.93 mysqld
3006 me 20 0 667m 55m 8028 S 17.2 0.7 1:49.98 mysqld
2967 me 20 0 677m 53m 8132 S 16.6 0.7 1:35.39 mysqld
3011 me 20 0 667m 46m 8244 S 16.2 0.6 1:42.37 mysqld
3010 me 20 0 667m 46m 8140 S 15.9 0.6 1:30.93 mysqld
3017 me 20 0 677m 46m 8112 S 13.9 0.6 1:38.93 mysqld
3086 me 20 0 667m 47m 8052 S 10.3 0.6 1:23.74 mysqld
3012 me 20 0 1051m 55m 8708 S 8.6 0.7 0:52.48 mysqld
2949 me 20 0 1051m 55m 8884 S 7.6 0.7 0:29.10 mysqld
3327 me 20 0 186m 14m 1708 S 4.6 0.2 0:24.42 perl
3280 me 20 0 186m 12m 848 S 1.7 0.2 0:08.53 perl
3260 me 20 0 186m 12m 848 S 1.0 0.2 0:08.54 perl
3253 me 20 0 186m 12m 848 S 0.7 0.2 0:06.89 perl
3300 me 20 0 186m 12m 848 S 0.7 0.2 0:06.87 perl
3288 me 20 0 186m 13m 848 S 0.3 0.2 0:02.51 perl
3312 me 20 0 186m 13m 848 S 0.3 0.2 0:02.06 perl
3343 me 20 0 186m 13m 848 S 0.3 0.2 0:02.74 perl
As you can see, we're loosing a lot of CPU on Perl.
Maybe we can do things to tune it?
Two example threads:
http://www.webmasterworld.com/forum13/1575.htm
http://www.ccl4.org/~nick/P/Fast_Enough/
--
Kind regards,
God Bless,
Roel Van de Paar | Senior QA Engineer
Mobile: +61 0400 225 827
Oracle MySQL Server QA
Oracle Australia | NSW 2440
Oracle is committed to developing practices and products that help protect
the environment
--------------------------------------------------------------------------------
_______________________________________________
Mailing list: https://launchpad.net/~randgen
Post to : randgen@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~randgen
More help : https://help.launchpad.net/ListHelp
References