Issue information

Issue ID
#3506
Status
Invalid
Severity
None
Started
Hercules Elf Bot
Aug 17, 2009 16:48
Last Post
Hercules Elf Bot
Apr 18, 2012 15:24
Confirmation
N/A

Hercules Elf Bot - Aug 17, 2009 16:48

Originally posted by [b]HiddenDragon[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3506

Hello folks, I've been trying to find sources of lag in clif.c by packet using code based on ultramage's core timer functions and here's what I've found using a server with ~1000 players:

CODE
[Debug]: processed packet function movetokafra... in 827 ms
[Debug]: processed timer mob_ai_hard... in 1038 ms
[Debug]: processed packet function movefromkafra... in 1154 ms
[Debug]: processed packet function useskilltoid... in 530 ms
[Debug]: processed packet function npcselectmenu... in 513 ms
[Debug]: processed timer unit_attack_timer... in 569 ms
[Debug]: processed packet function useskilltoid... in 722 ms
[Debug]: processed timer unit_attack_timer... in 537 ms
[Debug]: processed timer skill_unit_timer... in 548 ms
[Debug]: processed timer skill_unit_timer... in 606 ms
[Debug]: processed timer mob_ai_hard... in 541 ms
[Debug]: processed packet function takeitem... in 555 ms
[Debug]: processed packet function movefromkafra... in 644 ms
[Debug]: processed timer unit_attack_timer... in 1048 ms
[Debug]: processed packet function movetokafra... in 505 ms
[Debug]: processed packet function movefromkafra... in 863 ms
[Debug]: processed packet function movefromkafra... in 777 ms
[Debug]: processed packet function movetokafra... in 634 ms
[Debug]: processed packet function dropitem... in 687 ms
[Debug]: processed packet function movetokafra... in 585 ms
[Debug]: processed packet function useitem... in 672 ms
[Debug]: processed packet function useitem... in 950 ms
[Debug]: processed packet function npcselllistsend... in 589 ms
[Debug]: processed packet function useitem... in 522 ms
[Debug]: processed packet function movetokafra... in 537 ms
[Debug]: processed packet function movetokafra... in 607 ms
[Debug]: processed timer unit_attack_timer... in 847 ms
[Debug]: processed timer unit_attack_timer... in 526 ms
[Debug]: processed packet function movetokafra... in 898 ms
[Debug]: processed packet function movetokafra... in 824 ms
[Debug]: processed packet function movefromkafra... in 910 ms
[Debug]: processed timer unit_attack_timer... in 525 ms
[Debug]: processed packet function useskilltoid... in 634 ms
[Debug]: processed packet function movefromkafra... in 718 ms
[Debug]: processed packet function movefromkafra... in 662 ms
[Debug]: processed packet function movefromkafra... in 801 ms
[Debug]: processed timer unit_attack_timer... in 588 ms
[Debug]: processed packet function movetokafra... in 506 ms
[Debug]: processed packet function movefromkafra... in 518 ms
[Debug]: processed timer skill_castend_id... in 950 ms
[Debug]: processed timer mob_ai_hard... in 858 ms
[Debug]: processed packet function dropitem... in 696 ms


In this snippet, any clif.c function with over 500ms process time gets trapped and displayed in console. I also had ultramage's timer functions implemented and you can see that the primary sources of server lag is caused by a select few packet processing functions. This is on a Quad Core Xeon 2.4 GHz processor with 4 GB of RAM where the load average is only 1.11 according to top.

Is there any way we can improve these functions?

Hercules Elf Bot - Dec 17, 2011 5:07

Originally posted by [b]Ind[/b]
I'm not sure your data is accurate oO some of these like unit_attack_timer are used a few hundred times a second and if they took as much as your debug messages claim the server would stagnate

Hercules Elf Bot - Dec 23, 2011 14:20

Originally posted by [b]GodLesZ[/b]
As pointed out in the old bug tracker, the delays depends on his logging functions.