CPU Cores and Redis

117 views
Skip to first unread message

Kashyap Mhaisekar

unread,
Jul 30, 2015, 6:09:05 PM7/30/15
to redi...@googlegroups.com
Hi,
Our redis servers are showing high CPU%.
I was wondering if single threaded model of CPU means that the thread is always bound to 1 CPU?

The box has 4 cores but we see only one CPU has 80% CPU while other 3 have hardly 10%. There are no other tasks running on the box.

Could you please let me know?

Thanks
Kashyap

Javier Guerra Giraldez

unread,
Jul 30, 2015, 6:44:32 PM7/30/15
to redi...@googlegroups.com
On Thu, Jul 30, 2015 at 5:08 PM, Kashyap Mhaisekar <kash...@gmail.com> wrote:
> I was wondering if single threaded model of CPU means that the thread is
> always bound to 1 CPU?

yes

--
Javier

Josiah Carlson

unread,
Jul 30, 2015, 7:17:56 PM7/30/15
to redi...@googlegroups.com
A small clarification: you should only have 1 active core with Redis unless/until it forks for snapshotting/aof rewriting. But it doesn't bind itself to a specific CPU, and may migrate from core to core, but only one core would be active at any one time.

 - Josiah


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Kashyap Mhaisekar

unread,
Jul 31, 2015, 1:00:36 AM7/31/15
to redi...@googlegroups.com

Thanks Josh. There is no property that determines if cores need to switch right?

Thanks
Kashyap

Josiah Carlson

unread,
Jul 31, 2015, 1:25:43 AM7/31/15
to redi...@googlegroups.com
On Thu, Jul 30, 2015 at 10:00 PM, Kashyap Mhaisekar <kash...@gmail.com> wrote:

Thanks Josh.

You're missing 2 letters in there ;) 

There is no property that determines if cores need to switch right?

Redis doesn't do anything explicit or implicit to choose the core that it runs on. That is all controlled by the kernel scheduler, which you can override using the 'taskset' command in Linux, or similar functionality available on other OSes.

 - Josiah

Kashyap Mhaisekar

unread,
Jul 31, 2015, 10:46:25 AM7/31/15
to redi...@googlegroups.com
Sorry and thanks again Josiah :)
Reply all
Reply to author
Forward
0 new messages