Python Driver using too much CPU

128 views
Skip to first unread message

Gabriel Menegatti

unread,
Feb 4, 2015, 7:57:10 PM2/4/15
to python-dr...@lists.datastax.com
Hello,

We use the latest version of Python Driver (2.1.4), using Unthrottled Futures and we create one session for each one of the 6 process that we run inside a single server, so 6 sessions in total per server.

The thing is that when our processes finish to execute, we notice that the CPU consumption keeps around 20% to 30%, what we think its really a lot for just a driver.

We have a 4 core / 4 thread (Core i5-3570S, 3.1 GHz+) server with 16 GB of RAM and spinning disks.

Please, is it really "normal" to have the Python Driver (with 6 sessions created) using 20% to 30% of the CPU?

Thanks in advance.

Regards,
Gabriel.

Gabriel Menegatti

unread,
Feb 4, 2015, 8:35:10 PM2/4/15
to python-dr...@lists.datastax.com
Hi,

Just complementing...

We made a test closing each session once the process finished running and the CPU utilization simply disappeared.

So, I think the problem was the sessions using too much CPU.

Thanks

Adam Holmberg

unread,
Feb 5, 2015, 10:19:11 AM2/5/15
to python-dr...@lists.datastax.com
This depends on which reactor you are using. Unfortunately the asyncore reactor does use CPU at idle. Asyncore is the default connection class if the libev extension is not built.

If possible, make sure libev is present when building/installing the driver:

Adam Holmberg

To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-u...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages