SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Tue Apr 16, 2024 20:46
SMSTools3 Community » Bug reports Bottom

High CPU usage

Login and Post Reply

Page:  1

Author Post
Member
Registered:
Feb 2014
Location: Horsens, Denmark
Hi

I find the current cpu usage a bit high even though smsd only is idling (not moving any messages)- especially on lower spec'ed computers.

After a bit investigation i found that usleep_until() in extras.c only usleeps in intervals of 100 microseconds - which might be a bit too low and sorta creates a pseudo busy loop wait.

This small patch lowered CPU consumption quite a bit:

diff -u extras.c.old extras.c
--- extras.c.old 2014-02-11 15:18:58.526777555 +0100
+++ extras.c 2014-02-11 15:19:46.845312164 +0100
@@ -1445,7 +1445,7 @@
return 1;

if (now < target_time)
- usleep(100);
+ usleep(1000);
}
while (now < target_time);


« Last edit by hoerup on Tue Feb 11, 2014 14:27, 123 months ago. »
Member
Registered:
Feb 2014
Location: Horsens, Denmark
Topic owner
Or calculate how many small loops are necesarry first and avoid the calls to gettimeofday()


Login and Post Reply

Page:  1

SMSTools3 Community » Bug reports Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.