Anonymous | Login | Signup for a new account | 2024-04-24 12:42 UTC |
My View | View Issues | Change Log | Roadmap | Zandronum Issue Support Ranking | Rules | My Account |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0003620 | Zandronum | [All Projects] Bug | public | 2019-03-10 22:18 | 2019-06-04 20:18 | ||||||||
Reporter | voidpointer | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Platform | Ubuntu 18.10 | OS | Ubuntu 18.10 | OS Version | |||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0003620: Unnecessarily high CPU usage when zandronum-server is idle | ||||||||||||
Description | When there are zero connected clients for an instance of zandronum-server, I am seeing around 8-10% CPU usage. This is not scalable. There should be as close to 0% CPU usage as possible when there are no connected clients for a server instance of Zandronum. After looking at the Zandronum code base a bit, I see this in sv_main.cpp: lPreviousTics = static_cast<LONG> ( g_lGameTime / (( 1.0 / TICRATE ) * 1000.0 ) ); lNowTime = I_MSTime( ); lNewTics = static_cast<LONG> ( lNowTime / (( 1.0 / TICRATE ) * 1000.0 ) ); lCurTics = lNewTics - lPreviousTics; while ( lCurTics <= 0 ) { // [BB] Recieve packets whenever possible (not only once each tic) to allow // for an accurate ping measurement. SERVER_GetPackets( ); I_Sleep( 1 ); lNowTime = I_MSTime( ); lNewTics = static_cast<LONG> ( lNowTime / (( 1.0 / TICRATE ) * 1000.0 ) ); lCurTics = lNewTics - lPreviousTics; } The delta calculations are strange and confusing, but the `I_Sleep(1)` is very inefficient for the CPU. The sleep needs to be longer so the OS can schedule other work for the CPU. Could we make this an `I_Sleep(500)` (2 FPS) when there are 0 connected clients, and bump it back up to 35 FPS when 1 or more clients are connected? | ||||||||||||
Attached Files | |||||||||||||
Notes | |
(0020722) Dusk (developer) 2019-06-04 20:18 |
Perhaps we could make Zandronum call select() when there are no clients connected? |
Only registered users can voice their support. Click here to register, or here to log in. | |
Supporters: | No one explicitly supports this issue yet. |
Opponents: | No one explicitly opposes this issue yet. |
Issue History | |||
Date Modified | Username | Field | Change |
2019-03-10 22:18 | voidpointer | New Issue | |
2019-06-04 20:18 | Dusk | Note Added: 0020722 |
Copyright © 2000 - 2024 MantisBT Team |