SphereCommunity
Sphere.ini network settings on live server - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Sphere.ini network settings on live server (/Thread-Sphere-ini-network-settings-on-live-server)

Pages: 1 2


Sphere.ini network settings on live server - tleilax - 02-05-2014 05:40 AM

Hello,

what network settings would you recommend for live server with about 30 players online? The game really lags while in item heavy or crowded areas. Also, it gets really laggy while as GM, I port to random area. Also, using .tele has slight delay (half a second).

Current sphere.ini:
Code:
// Disconnect inactive socket in x min
DeadSocketTime=5

// Maximum number of packets to send per tick
MaxPacketsPerTick=25

// Number of connections a client can make before being blocked
MaxPings=100

// Maximum number of packets before lowering packet priorities (0 for no limit)
MaxQueueSize=50

// Maximum number of bytes to send per tick (also governs maximum size of outgoing packets)
MaxSizePerTick=12000

// Time to remember previous connection history (seconds)
NetTTL=300

// Use asynchronous data sends (changing this setting at runtime may produce unexpected behaviour)
//  0 = Off
//  1 = On
//  2 = On for 4.0.0+ game clients only
UseAsyncNetwork=0

// Prioritise outgoing packets (provides a smoother experience in crowded areas)
UsePacketPriority=0

// Enables an additional buffer for outgoing data.
UseExtraBuffer=1

// Tooltip modes
//  0 = Always send full tooltip
//  1 = Wait for client to request full tooltip
TooltipMode=1

// Time to cache tooltip data for (seconds)
TooltipCache=0

// Automatically invalidate and resend tooltips when:
//  0001    item or character name changes
//  0002    item amount changes
//  0004    container weight changes
//  0008    weapon or armor durability changes
//  0010    weapon poison charge changes
//  0020    wand charge changes
//  0040    spell added to spellbook
AutoTooltipResend=07f

// Number of network threads. Clients are distributed evenly amongst each thread. Set to 0 to not
// use a separate networking thread.
NetworkThreads=0

// If network threads are used, this controls the priority they are assigned.
//  0   = Idle
//  1   = Low
//  2   = Normal
//  3   = High
//  4   = Highest
//  5   = Real-time
//  255 = Automatic (recommended)
NetworkThreadPriority=255

Also, Xeon 2.5GHz (1 thread), 2 GB RAM, Windows server 2012, gigabit line - could the problem be there?

Thanks for any advice.


RE: Sphere.ini network settings on live server - XuN - 02-05-2014 06:13 AM

Try this:
UseAsyncNetwork=1
NetworkThreads=2,3,4... (test them)
UsePacketPriority=1

and if you are still having lag issues put a higher value in MaxPacketsPerTick


RE: Sphere.ini network settings on live server - tleilax - 02-05-2014 06:37 AM

I've set it to:
UseAsyncNetwork=1
NetworkThreads=4 (tested all 3)
UsePacketPriority=1
MaxPacketsPerTick=50

It might be a bit better, but still laggy. Sad
I might try using another server with linux sphere...


RE: Sphere.ini network settings on live server - XuN - 02-05-2014 06:51 AM

Network threads are created upon server start, not after resync, however you can set it to higher values, try enabling / disabling these values or increasing / lowering them until you feel fine.


RE: Sphere.ini network settings on live server - tleilax - 02-06-2014 06:11 AM

Code:
Profiles ON: (1 sec total)
Thread 1968, Name=NetworkThread #0
IDLE       =   1.1091s  avg:   0.9999s  [samples:    37  avg:    33 ]  runtime: 304s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 304s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     3  avg:     0 ]  runtime: 304s
NETWORK_TX =   0.0002s  avg:   0.0001s  [samples:    17  avg:    10 ]  runtime: 304s
DATA_TX    = 78 (avg: 75) bytes
DATA_RX    = 22 (avg: 7) bytes
FAULTS     = 0 (total: 0) instances
Thread 1144, Name=NetworkThread #1
IDLE       =   1.4059s  avg:   0.9999s  [samples:    32  avg:    36 ]  runtime: 316s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 316s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     4  avg:     0 ]  runtime: 316s
NETWORK_TX =   0.0001s  avg:   0.0001s  [samples:    14  avg:    12 ]  runtime: 316s
DATA_TX    = 270 (avg: 165) bytes
DATA_RX    = 13 (avg: 4) bytes
FAULTS     = 0 (total: 0) instances
Thread 3984, Name=NetworkThread #2
IDLE       =   0.9996s  avg:   0.9998s  [samples:    72  avg:   133 ]  runtime: 381s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 381s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     8  avg:    14 ]  runtime: 381s
NETWORK_TX =   0.0005s  avg:   0.0003s  [samples:    31  avg:    50 ]  runtime: 381s
DATA_TX    = 2640 (avg: 776) bytes
DATA_RX    = 52 (avg: 61) bytes
FAULTS     = 0 (total: 0) instances
Thread 3028, Name=NetworkThread #3
IDLE       =   0.9998s  avg:   0.9999s  [samples:    18  avg:    44 ]  runtime: 331s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 331s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 331s
NETWORK_TX =   0.0001s  avg:   0.0001s  [samples:    10  avg:    14 ]  runtime: 331s
DATA_TX    = 20 (avg: 89) bytes
DATA_RX    = 0 (avg: 14) bytes
FAULTS     = 0 (total: 0) instances
Thread 260, Name=NetworkThread #4
IDLE       =   1.5624s  avg:   0.9999s  [samples:    20  avg:    52 ]  runtime: 314s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 314s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 314s
NETWORK_TX =   0.0001s  avg:   0.0001s  [samples:    10  avg:    19 ]  runtime: 314s
DATA_TX    = 29 (avg: 292) bytes
DATA_RX    = 0 (avg: 10) bytes
FAULTS     = 0 (total: 0) instances
Thread 1052, Name=NetworkThread #5
IDLE       =   1.0150s  avg:   0.9999s  [samples:    78  avg:    95 ]  runtime: 375s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 375s
NETWORK_RX =   0.0001s  avg:   0.0000s  [samples:    16  avg:     5 ]  runtime: 375s
NETWORK_TX =   0.0004s  avg:   0.0003s  [samples:    31  avg:    36 ]  runtime: 375s
DATA_TX    = 644 (avg: 267) bytes
DATA_RX    = 97 (avg: 34) bytes
FAULTS     = 0 (total: 0) instances
Thread 2968, Name=NetworkThread #6
IDLE       =   2.4062s  avg:   1.0417s  [samples:     8  avg:    25 ]  runtime: 46s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 46s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 46s
NETWORK_TX =   0.0000s  avg:   0.0000s  [samples:     4  avg:     8 ]  runtime: 46s
DATA_TX    = 60 (avg: 145) bytes
DATA_RX    = 0 (avg: 13) bytes
FAULTS     = 0 (total: 0) instances
Thread 2352, Name=NetworkThread #7
IDLE       =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
NETWORK_TX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
DATA_TX    = 0 (avg: 0) bytes
DATA_RX    = 0 (avg: 0) bytes
FAULTS     = 0 (total: 0) instances
Thread 2636, Name=NetworkThread #8
IDLE       =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
NETWORK_TX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
DATA_TX    = 0 (avg: 0) bytes
DATA_RX    = 0 (avg: 0) bytes
FAULTS     = 0 (total: 0) instances
Thread 1100, Name=NetworkThread #9
IDLE       =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
OVERHEAD   =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
NETWORK_RX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
NETWORK_TX =   0.0000s  avg:   0.0000s  [samples:     0  avg:     0 ]  runtime: 1s
DATA_TX    = 0 (avg: 0) bytes
DATA_RX    = 0 (avg: 0) bytes
FAULTS     = 0 (total: 0) instances
Thread 3840, Name=Main
IDLE       =   0.8617s  avg:   0.8900s  [samples:   742  avg:  1351 ]  runtime: 400s
OVERHEAD   =   0.0019s  avg:   0.0017s  [samples:   625  avg:  1119 ]  runtime: 400s
NETWORK_RX =   0.0005s  avg:   0.0004s  [samples:   117  avg:   212 ]  runtime: 400s
CLIENTS    =   0.0024s  avg:   0.0027s  [samples:    38  avg:    45 ]  runtime: 400s
CHARS      =   0.0072s  avg:   0.0117s  [samples:  1555  avg:  2825 ]  runtime: 400s
ITEMS      =   0.0072s  avg:   0.0046s  [samples:  1234  avg:  2257 ]  runtime: 400s
MAP        =   0.0220s  avg:   0.0164s  [samples:  6392  avg:  7373 ]  runtime: 400s
NPC_AI     =   0.0842s  avg:   0.0668s  [samples:  6687  avg:  7871 ]  runtime: 400s
SCRIPTS    =   0.0125s  avg:   0.0115s  [samples:    27  avg:    99 ]  runtime: 400s
FAULTS     = 0 (total: 0) instances
Scripts: called 2509437 times and took 223554.1251 msec (0.0888 msec average). Reporting with highest average.
FUNCTION 'f_onserver_start' called 1 times, took 98.5437 msec average (98.5437 min, 98.5437 max), total: 98.5437 msec
FUNCTION 'f_change_light1' called 1 times, took 0.1846 msec average (0.1846 min, 0.1846 max), total: 0.1846 msec
FUNCTION 'f_change_light2' called 1 times, took 63.2939 msec average (63.2939 min, 63.2939 max), total: 63.2939 msec
FUNCTION 'f_change_light3' called 1 times, took 0.1198 msec average (0.1198 min, 0.1198 max), total: 0.1198 msec
FUNCTION 'f_change_light4' called 1 times, took 0.0927 msec average (0.0927 min, 0.0927 max), total: 0.0927 msec
FUNCTION 'f_change_light5' called 1 times, took 4.5979 msec average (4.5979 min, 4.5979 max), total: 4.5979 msec
FUNCTION 'f_onserver_timer' called 26 times, took 67.2003 msec average (17.1757 min, 124.8457 max), total: 1747.2109 msec
FUNCTION 'f_onaccount_login' called 63 times, took 0.4601 msec average (0.2268 min, 1.1763 max), total: 29.0039 msec
FUNCTION 'meditationcheck' called 61 times, took 0.4110 msec average (0.3252 min, 0.5431 max), total: 25.0718 msec
FUNCTION 'f_mysql_login' called 31 times, took 139.8751 msec average (100.2162 min, 191.3403 max), total: 4336.1355 msec
FUNCTION 'check_accounts' called 31 times, took 0.7837 msec average (0.6177 min, 2.0975 max), total: 24.3006 msec
FUNCTION 'resync' called 15 times, took 431.5903 msec average (0.2570 min, 2341.0103 max), total: 6473.8591 msec
FUNCTION 'fixaction_is_combat' called 1461 times, took 0.0947 msec average (0.0407 min, 0.2386 max), total: 138.7049 msec
FUNCTION 'f_chargeperday' called 3 times, took 1.2520 msec average (0.9016 min, 1.8815 max), total: 3.7566 msec
FUNCTION 'f_mysql_server_first_skills' called 135 times, took 6.5934 msec average (0.0125 min, 10.4238 max), total: 890.1475 msec
FUNCTION 'f_mysql_logout' called 20 times, took 32.5129 msec average (14.9030 min, 47.5082 max), total: 650.2604 msec
FUNCTION 'admin' called 18 times, took 2.2151 msec average (0.4775 min, 16.7298 max), total: 39.8767 msec
FUNCTION 'admin_renderdialog' called 19 times, took 0.7245 msec average (0.1595 min, 1.3615 max), total: 13.7683 msec
FUNCTION 'helppage' called 6 times, took 15.6102 msec average (14.3542 min, 16.9963 max), total: 93.6621 msec
FUNCTION 'f_mysql_online' called 6 times, took 0.5861 msec average (0.3928 min, 0.8063 max), total: 3.5177 msec
FUNCTION 'f_mysql_accounts' called 6 times, took 14.7893 msec average (13.4135 min, 16.1978 max), total: 88.7365 msec
FUNCTION 'f_heal_fce' called 6 times, took 0.1567 msec average (0.1402 min, 0.1844 max), total: 0.9404 msec
FUNCTION 'checks' called 155 times, took 0.3646 msec average (0.3081 min, 0.5540 max), total: 56.5529 msec
FUNCTION 'f_gain_dex' called 605 times, took 0.2112 msec average (0.1656 min, 0.5171 max), total: 127.8111 msec
FUNCTION 'f_controlstats' called 1419 times, took 0.1626 msec average (0.1131 min, 0.3651 max), total: 231.0673 msec
FUNCTION 'f_gain_str' called 605 times, took 0.2078 msec average (0.1628 min, 0.4093 max), total: 125.8767 msec
FUNCTION 'f_gain_int' called 209 times, took 0.2006 msec average (0.1542 min, 0.3710 max), total: 41.9636 msec
FUNCTION 'rusthealingu' called 152 times, took 0.1659 msec average (0.1441 min, 0.3238 max), total: 25.2550 msec
FUNCTION 'nicenibrneni' called 508 times, took 0.6803 msec average (0.5912 min, 1.5926 max), total: 345.6325 msec
FUNCTION 'rustbojovehoskillu' called 508 times, took 0.3992 msec average (0.0338 min, 1.2425 max), total: 202.9561 msec
FUNCTION 'rustparryingu' called 508 times, took 0.2478 msec average (0.0120 min, 1.0966 max), total: 126.0340 msec
FUNCTION 'rustanatomy' called 508 times, took 0.1248 msec average (0.0307 min, 0.6146 max), total: 63.4775 msec
FUNCTION 'nicenizbrani' called 576 times, took 0.1899 msec average (0.0933 min, 0.5621 max), total: 109.5456 msec
FUNCTION 'tradebug' called 20 times, took 0.4509 msec average (0.0382 min, 0.9552 max), total: 9.0206 msec
FUNCTION 'omezeninablizko1' called 52 times, took 0.0952 msec average (0.0754 min, 0.1693 max), total: 4.9647 msec
FUNCTION 'rusttrackingu' called 15 times, took 0.1218 msec average (0.0667 min, 0.1419 max), total: 1.8309 msec
FUNCTION 'f_onserver_save' called 2 times, took 229.9287 msec average (224.6057 min, 235.2517 max), total: 459.8575 msec
FUNCTION 'f_onserver_save_finished' called 2 times, took 0.1631 msec average (0.1338 min, 0.1927 max), total: 0.3266 msec
FUNCTION 'bandageself' called 198 times, took 1.3869 msec average (0.0986 min, 11.7557 max), total: 274.6328 msec
FUNCTION 'omezeninablizko2' called 95 times, took 0.1003 msec average (0.0868 min, 0.1673 max), total: 9.5392 msec
FUNCTION 'meditation_skillgain' called 8 times, took 1.0047 msec average (0.7096 min, 1.5398 max), total: 8.0379 msec
FUNCTION 'f_skillgain' called 9 times, took 0.9452 msec average (0.6957 min, 1.3861 max), total: 8.5093 msec
FUNCTION 'f_gain_skill_3' called 9 times, took 0.1304 msec average (0.0709 min, 0.2042 max), total: 1.1743 msec
FUNCTION 'enticement_failure' called 1 times, took 1.4425 msec average (1.4425 min, 1.4425 max), total: 1.4425 msec
FUNCTION 'enticement_skillgain' called 1 times, took 1.4104 msec average (1.4104 min, 1.4104 max), total: 1.4104 msec
FUNCTION 'respawntile1' called 3 times, took 1.6272 msec average (0.0106 min, 3.7345 max), total: 4.8823 msec
FUNCTION 'addbuttonsvendor' called 1 times, took 2.0050 msec average (2.0050 min, 2.0050 max), total: 2.0050 msec
FUNCTION 'pay' called 1 times, took 0.3847 msec average (0.3847 min, 0.3847 max), total: 0.3847 msec
FUNCTION 'goldtopack' called 1 times, took 0.1807 msec average (0.1807 min, 0.1807 max), total: 0.1807 msec
TRIGGER '@step' called 742 times, took 3.9564 msec average (0.0044 min, 1068.8971 max), total: 2935.6954 msec
TRIGGER '@spelleffect' called 25 times, took 0.7365 msec average (0.0097 min, 1.2335 max), total: 18.4151 msec
TRIGGER '@itemclienttooltip' called 23983 times, took 5.2358 msec average (0.0480 min, 34.9578 max), total: 125575.4601 msec
TRIGGER '@login' called 62 times, took 72.1156 msec average (0.5931 min, 193.9977 max), total: 4471.1841 msec
TRIGGER '@personalspace' called 54 times, took 0.1522 msec average (0.1190 min, 0.2601 max), total: 8.2235 msec
TRIGGER '@spellcast' called 33 times, took 196.1877 msec average (0.0100 min, 2341.5912 max), total: 6474.2036 msec
TRIGGER '@skillstart' called 4369 times, took 0.6733 msec average (0.0131 min, 4.7490 max), total: 2942.5607 msec
TRIGGER '@death' called 14 times, took 0.7189 msec average (0.0251 min, 7.0502 max), total: 10.0659 msec
TRIGGER '@deathcorpse' called 4 times, took 29.2657 msec average (0.0709 min, 106.2447 max), total: 117.0634 msec
TRIGGER '@gethit' called 1277 times, took 1.4571 msec average (0.0273 min, 6.9891 max), total: 1860.9709 msec
TRIGGER '@logout' called 55 times, took 12.4867 msec average (0.1860 min, 49.1221 max), total: 686.7806 msec
TRIGGER '@itemdclick' called 1254 times, took 0.1405 msec average (0.0142 min, 0.5498 max), total: 176.5607 msec
TRIGGER '@success' called 103 times, took 0.1313 msec average (0.0268 min, 0.7183 max), total: 13.5275 msec
TRIGGER '@fail' called 32 times, took 0.1288 msec average (0.0290 min, 0.2905 max), total: 4.1285 msec
TRIGGER '@hit' called 604 times, took 0.3679 msec average (0.0924 min, 0.8868 max), total: 222.3953 msec
TRIGGER '@itempickup_ground' called 27 times, took 0.1165 msec average (0.0167 min, 0.3302 max), total: 3.1469 msec
TRIGGER '@targon_char' called 41 times, took 4.2048 msec average (0.1254 min, 11.7840 max), total: 172.4068 msec
TRIGGER '@regionresourcefound' called 16 times, took 0.3478 msec average (0.1891 min, 0.4165 max), total: 5.5688 msec
TRIGGER '@npcheargreeting' called 2 times, took 0.1584 msec average (0.1542 min, 0.1626 max), total: 0.3168 msec
TRIGGER '@npchearunknown' called 1 times, took 0.2632 msec average (0.2632 min, 0.2632 max), total: 0.2632 msec
TRIGGER '@itempickup_pack' called 70 times, took 0.1793 msec average (0.0206 min, 0.4906 max), total: 12.5632 msec

Do you see anything unusual here?
RESYNC is probably players trying to use .resync to "unstuck" them while in lag

Mostly, it will hang your character when going through moongate (switching to whole another region). It will freeze your character and in console is this:
Code:
21:12:WARNING:45:Unknown game packet (0x35) received.
21:12:WARNING:45:Unknown game packet (0x1a) received.
21:12:WARNING:45:Unknown game packet (0xea) received.



RE: Sphere.ini network settings on live server - XuN - 02-06-2014 07:45 AM

TRIGGER '@itemclienttooltip' called 23983 times, took 5.2358 msec average (0.0480 min, 34.9578 max), total: 125575.4601 msec

It's taking a lot more of time and runs than any other triggers o functions, so this and the problem with moongates that you described makes me think you have a lot of non-static items, wich needs to be loaded with their consequent executions and bandwich usage, try to not have non - static items, patch them to the files.


BTW: I was told by Darksun that NetworkTreads and AsyncNetwork are giving some problems, so deactivate them for now... they wouldn't fix your problem even working fine Smile


RE: Sphere.ini network settings on live server - tleilax - 02-06-2014 07:39 PM

You were right, I disabled the trigger/script and now it's almost perfect.

I guess I have same problem as this guy:
http://forum.spherecommunity.net/Thread-NEED-FIX-IT-ClientToolTip-and-ItemClientToolTip

Any way to force the client not to preload tooltips and load them only when mouse is over items/chars? Already got "TooltipMode=1", but that doesn't help.


RE: Sphere.ini network settings on live server - XuN - 02-07-2014 04:05 AM

This is the way, items are loaded from the client when it see them (or receive a update packet from them), some data is sent and when you mouse over the item the rest of the data is sent with tooltipmode=1


RE: Sphere.ini network settings on live server - tleilax - 02-07-2014 04:11 AM

So this script is absolutely unsafe:

Code:
default character event:
on=@itemclienttooltip
if (<act.type>==t_test)
  addcliloc xxxx,test
endif

It will fire when there is any non static object on any connected player's screen, which lagged my server terribly. Am I right?


RE: Sphere.ini network settings on live server - XuN - 02-07-2014 04:26 AM

Sure, what is unsafe is not to use this trigger, is to have such insane amount of items being loaded... they will end up giving you lag if you have more players, even without tooltips, the real solution is to patch them to the statics files.