Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic usage is slightly higher than normal server #26

Open
matpow2 opened this issue Jul 18, 2013 · 2 comments
Open

Traffic usage is slightly higher than normal server #26

matpow2 opened this issue Jul 18, 2013 · 2 comments

Comments

@matpow2
Copy link
Owner

matpow2 commented Jul 18, 2013

Just making a single issue for this. The reason for the higher traffic is due to the way entities are handled, as currently only full entity updates are sent. Need to check for changes to the entity, and only send changed attributes.

@Jakky89
Copy link

Jakky89 commented Jul 19, 2013

Maybe just decrease FPS of the server in the constants to 25. I have tested it and it seems to run with lesser laggs than with 50 FPS. It's just one possibility.

Also you could take a look into my fork where I made some (hopefully) improvements like sending the time every second instead of every update call: Jakky89@ae7171e

This is the important part for network packages that don't need to be sent in such a high frequency (in the server.py update procedure):

        # secondly check
        secondly_check = False
        uxtime = int(reactor.seconds())
        if uxtime != self.last_secondly_check:
            self.last_secondly_check = uxtime
            secondly_check = True

Then you simply can check if the secondly_check flag is set everywhere in the procedure to perform non-high-frequency updates like this:

        if secondly_check:
            # time update
            time_packet.time = self.get_time()
            time_packet.day = self.get_day()
            self.broadcast_packet(time_packet)

Also I begun integrating SQLite (for players onlinetime, last online times, (temp-)bans etc.) and I will commit the newer changes in a few hours or days I think.

@matpow2
Copy link
Owner Author

matpow2 commented Jul 20, 2013

This should be fixed trunk through the partial entity updates. Hopefully people can confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants