Our objectives for September where few, but we have good new, we achoved one with massive and speacial thanks to our member lei2, the project now build on linuix devices.

I was hopeing to have a demo test centre up for this weekend however the server maxes out the box while doing nothing... so adding traffic to that might be a little unwise, so for the remainder of October and November the main project objectives are to make the code a little more stable and linux friendly, remove out dated deps while updating the code (though this is and will be an ongoing objective) and generally tidy things up.

I'm going to open up new forums for this project so once we a dedicated place to discuss and document whats we are doing.

We still need you, your our only hope......

Obi.

Edit: Yes I missed out Septembers development objectives post, if you read the August thread you'll see why

Currently I do still work on networking, meanwhile I got quite familiar with it. But it will take some time since there is a bit more to do than I expected.

In the meantime, a tiny little update might help to reduce the load issue. Because Halloween is near it might be called the sleeping Dragon Utility. Usually a Dragon sleeps on his heap of gold, opening an eye from time to time to see if something comes along that needs his special attention. If something comes along in his idle cycle, it will stumble over his well laid gold. So the noise wakes him up and now something gets his attention.

/*---------------------------------------------------------------------------------------This source file is part of SWG:ANH (Star Wars Galaxies - A New Hope - Server Emulator)Copyright (c) 2015 Unofficial Hope Edition, leiUse of this source code is governed by the GPL v3 license, see COPYING in project root.---------------------------------------------------------------------------------------Pipe Utility

For polling queues the wait method can be used as replacement for the sleep. If thereis work to do, a send after something pushes into the queue will then wake the wait.

To reflect load situations, wait returns the number of items in the pipe. So if waitreturns higher values than 1, the pushers put more into the queue as the worker can popin its cycle. The worker might use the return then to bypass the wait for the nextcycle.

Note: Due to the nature of pipes and select, each wait needs its own pipe.

Note: If methods are realized in cpp, this class would share them over program borders which may lead to issues. Instead of changing the cmake ruleset, they are simply implemented here.---------------------------------------------------------------------------------------*/

Put the above code as pipe.h into src/Utils directory. Edit src/NetworkManager/SocketWriteThread.h then:- Add #include "Utils/pipe.h"- above Class SocketWriteThread add using namespace utils;- In bottom, under SessionQueueLight mAsyncSessionQueue add Pipe* sessionPipe;Now edit src/NetworkManager/SocketWriteThread.cpp. In Constructor - line 50 or so - add sessionPipe = new Pipe(); then near line 174 at bottom of SocketWriteThread::run() there is a directive boost::this_thread::sleep(boost::posix_time::milliseconds(1));Replace it with sessionPipe->wait(2000);In line 311, SocketWriteThread::NewSession(..) under mSessionQueue.push(session); addsessionPipe->send('X'); and another in line 341 under mSessionQueue.push(session);

So far for the SocketWrite. In SocketReadThread.cpp line 194 the tv_usec can be set a bit higher too, 500 should work. In src/Utils/ActiveObject.cpp add and usleep(2000) between line 66/67. Samefor other spots where sleep is used:ChatServer/ChatServer.cpp: boost::this_thread::sleep(boost::posix_time::milliseconds(1));ConnectionServer/ConnectionServer.cpp: boost::this_thread::sleep(boost::posix_time::milliseconds(1));LoginServer/LoginServer.cpp: boost::this_thread::sleep(boost::posix_time::milliseconds(10));NetworkManager/Service.cpp: boost::this_thread::sleep(boost::posix_time::milliseconds(10));NetworkManager/SocketReadThread.cpp: boost::this_thread::sleep(boost::posix_time::microseconds(10)); (<--- this doesnt make any sense here)PingServer/PingServer.cpp: boost::this_thread::sleep(boost::posix_time::milliseconds(1));Utils/Timer.cpp: boost::this_thread::sleep(boost::posix_time::milliseconds(10));ZoneServer/ZoneServer.cpp: boost::this_thread::sleep(boost::posix_time::milliseconds(1));

These can be set up decently, minimum is 20ms.

Setting up the sleep times its just a quick hack for the moment. For some of the sleeps the sleeping Dragon technique might be an approach to get the load issue under control.

My personal trunk meanwhile differs a lot from the original, so I am not completely sure how much this will help. I am using signals too, some modules are rewritten. All in all I now have 3% cpu use for login and chat, 6% for connection and a bit over 10% for a Zone with a stable system load under 0.5 for an idle system. That still is far from ideal, but already a bit closer to a working solution.

Thank you for the update, I will try and get them copied over as soon as I can,

I forsee cros platform problems, but at this time I'm only looking at liux building for our test centre but maybe soemthing to be mindful of other than that fantastic stuff.

lei2 wrote: In src/Utils/ActiveObject.cpp add and usleep(2000) between line 66/67. Samefor other spots where sleep is used:ChatServer/ChatServer.cpp: boost::this_thread::sleep(boost::posix_time::milliseconds(1));

ActiveObjects seem to grab things, if it has one or more it will set up an event timer, delay them a bit and then execute them. Add the usleep here to make it wait a bit if there is nothing to do. It will be a 2ms delay.If you want to you can use boost::this_thread::sleep(boost::posix_time::milliseconds(2) instead of the usleep. Also you can adjust the boost sleep in the while directive to sleep a bit longer, guess that will work as well.

For the other boost sleeps - nothing to add here, just adjust the sleep time a bit. It might need some experimenting to find the tolerable balance between answer time latency and system load for each server. You see differences in timing for the servers, that already reflect their timing needs for a straight answer. So for instance start with factor 3 for each timer and then see how it works. Depends on your system and how many sessions you expect.

There is one boost sleep in the heightmap load, that should stay 1 as it is.

And the last one - the sleep in socket read thread. Have no idea why its in there and what its good for, just delete it. It does only limit the packet receive to 50 packets per second.

edit src/NetworkManager/SocketWriteThread.cpp. In Constructor - line 50 or so - add sessionPipe = new Pipe();

,

as a further thought, in the interests of speed, would it be better for me to set up a folder via my own cloud server or drop box you can just update the src folder every now and again. would save all the typing haha

thank you again, i might have to paypal you some beer money one dayObi

Obi-Two wrote:as a further thought, in the interests of speed, would it be better for me to set up a folder via my own cloud server or drop box you can just update the src folder every now and again. would save all the typing haha

thank you again, i might have to paypal you some beer money one dayObi

Np, never mind. Ill set up a git acc if it once is too much to type. But else ... Im old-school, a bit typing helps in understanding and keeps fingers away from bad things ; )

And dont expect wonders from the timing things. They may help a bit, but wont make the polling issue go away.

lei2 wrote:Np, never mind. Ill set up a git acc if it once is too much to type. But else ... Im old-school, a bit typing helps in understanding and keeps fingers away from bad things ; )

And dont expect wonders from the timing things. They may help a bit, but wont make the polling issue go away.

Greetz, lei

it would be no problem I just like keep in the code moving forward, I'm not overly fuzzed about keeping boost, its wasa massive faff for me to build haha also I'm nto to bothered about it bebuild windows compatable, in this day and age its east to run a VM linux machine and push a server out, pluss as stated before who can afford a Windows Box to run threre server on unless they want a small private comunity runnig on a home laptop/pc but they I'd have to point them to the running of a VM server

I'll make the changes to the code and push it out, it might encourage others to help (might not lol)

Cheers Obi

EDIT:I think I missed something :S I get this on running the build server

This is the relevant line - the old logger doesnt understand the NOTICE severity. Replace it with ERR, that will work.

Obi-Two wrote:it would be no problem I just like keep in the code moving forward, I'm not overly fuzzed about keeping boost, its wasa massive faff for me to build haha also I'm nto to bothered about it bebuild windows compatable, in this day and age its east to run a VM linux machine and push a server out, pluss as stated before who can afford a Windows Box to run threre server on unless they want a small private comunity runnig on a home laptop/pc but they I'd have to point them to the running of a VM server

I'll make the changes to the code and push it out, it might encourage others to help (might not lol)

Thats exactly the point. Pull out a VM and run what is needed.

Dont know how some minor code changes might have a great influence but who knows. A little advance always is better as stagnation.

Btw for the testcenter ... did you try apt-get install cpulimit? https://wiki.ubuntuusers.de/cpulimitMight help to tame the beasts a bit, login and ping do not really need more than a few cpu%, chat and connection might work with 10% each, guess tat should run with 20% but tutorial and maybe corellia and naboo would be good with 10%.