Important: Do not post bugs. Please read the FAQ before posting (or your question may be ignored).

I left synergyc 1.4.2 running on a Gentoo Linux Intel 32 bit system using kernel 2.6.36-gentoo-r8 from the 4th of April, 2011 and as at the 2nd of May, 2011, it has used 6 hours, 50 minutes and 23 seconds of CPU and is constantly showing in 'top' as using around 1%.

It has been connected to a server on a laptop running the same version of Synergy, also Gentoo, Intel, 64 bit, using the same kernel version.

Both linux systems use 'Fluxbox', a lightweight Window manager.

I am curious as to why so much cpu is required for a 'client' program - particularly since I have not been anywhere near the client/server computers for the last 10 days.

The Server computer has only used 11 minutes 28 seconds of CPU in the last 12 days (it has been rebooted more recently than the client).

I would not expect that any traffic/processing would be sent/performed to/on the 'client' machine unless the 'mouse pointer' had moved to the 'client' space.

Additionally, I would expect the 'server' to consume more resources than the client, as it's the one that has to handle the keyboard/mouse all the time, not just sometimes.

asked 02 May '11, 02:27

lyallp's gravatar image

lyallp
964
accept rate: 50%

edited 02 May '11, 05:32

nbolton's gravatar image

nbolton ♦♦
1.8k128

Was the client disconnected from the server? We disabled the exponential retry mechanism for faster reconnects, but this has unfortunately had the side-effect of increasing CPU usage.

(02 May '11, 05:28) nbolton ♦♦

There was no significant (more than 10 minutes or so) of disconnect in the last month.

Even with an active connect, the client is using 1% CPU, which is exorbitant for the task it's doing. A web camera security system (ZoneMinder) uses less 50% CPU than the synergy client on the same computer.

(02 May '11, 06:00) lyallp

The problem is, in function CXWindowsEventQueueBuffer::waitForEvent, a call to poll() is issued with a ridiculously short poll timeout of 25 milliseconds. Why, in heavens name would you need to cycle 40 times a second when there is no activity?

I don't know the reasoning behind this but what is wrong with infinite timeout? If the connection fails, the poll() will return with an error?

I found this as my linux machine has full debugging symbols compiled in and I connected to the synergyc, with the resulting stack trace.

(gdb) where
#0  0xb7844424 in __kernel_vsyscall ()
#1  0xb7532815 in __poll (fds=0xb75b0ff4, nfds=2, timeout=25) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0x080a860b in CXWindowsEventQueueBuffer::waitForEvent (this=0x9b27958, dtimeout=4.9998728827340528)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/platform/CXWindowsEventQueueBuffer.cpp:163
#3  0x080894ef in CEventQueue::getEvent (this=0xbf9cdcec, event=..., timeout=-1)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/base/CEventQueue.cpp:152
#4  0x080778ba in CClientApp::mainLoop (this=0xbf9cdfdc)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/synergy/CClientApp.cpp:510
#5  0x08075dd6 in CApp::daemonMainLoop (this=0xbf9cdfdc)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/synergy/CApp.cpp:299
#6  0x08076c91 in daemonMainLoopStatic (argc=1, argv=0xbf9cde84)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/synergy/CClientApp.cpp:527
#7  0x0807a1cf in CArchDaemonUnix::daemonize (this=0x9b0e9b0, name=0x80b4ee7 "synergyc", 
    func=0x8076c70 <daemonMainLoopStatic(int, char const**)>)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/arch/CArchDaemonUnix.cpp:126
#8  0x08079e39 in standardStartupStatic (argc=7, argv=0xbf9ce0b4)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/arch/CArchAppUtilUnix.cpp:56
#9  0x08076b4a in CClientApp::runInner (this=0xbf9cdfdc, argc=7, argv=0xbf9ce0b4, outputter=0x0, 
    startup=0x8079e10 <standardStartupStatic(int, char**)>)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/synergy/CClientApp.cpp:560
#10 0x08079de7 in CArchAppUtilUnix::run (this=0x9b0e9d0, argc=7, argv=0xbf9ce0b4)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/arch/CArchAppUtilUnix.cpp:62
#11 0x08075e57 in CApp::run (this=0xbf9cdfdc, argc=7, argv=0xbf9ce0b4)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/lib/synergy/CApp.cpp:263
#12 0x0807329b in main (argc=7, argv=0xbf9ce0b4)
    at /tmp/portage/portage/x11-misc/synergy-1.4.2/work/synergy-1.4.2-Source/cmd/synergyc/synergyc.cpp:34
link

answered 02 May '11, 20:16

lyallp's gravatar image

lyallp
964
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×102
×94

Asked: 02 May '11, 02:27

Seen: 1,281 times

Last updated: 02 May '11, 20:16

powered by OSQA