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

Dreamhack changes #1

Merged
merged 7 commits into from Jan 28, 2017

Conversation

Projects
None yet
3 participants
@solariz
Contributor

solariz commented Jan 15, 2017

We succesfully used it at the Dreamhack DE, this is my commit some minutes before our dismantling starts :)
Added several games and added statistic log function to the code. This stat file was pushed to a influxDB so we directly could get some very interesting insights of what was received and forwarded exactly. SDH works pretty well, just had a few problems.

+ Added logging of port and interface pkt to a statistics file
+ optimize filter list enabled
+ minor changes
@solariz

This comment has been minimized.

Show comment
Hide comment
@solariz

solariz Jan 14, 2017

Owner

With disabled optimization I receive a mem alloc error if using a certain amount of ports.

Opening PCAP interface for eth1.110
Warning: Kernel filter failed: Cannot allocate memory
Error setting filterCouldn't create a listener for all interfaces. Exiting.

Enabled pcap filter optimiization and everything is fine.

Owner

solariz commented on sdh-proxy.c in 1f70fda Jan 14, 2017

With disabled optimization I receive a mem alloc error if using a certain amount of ports.

Opening PCAP interface for eth1.110
Warning: Kernel filter failed: Cannot allocate memory
Error setting filterCouldn't create a listener for all interfaces. Exiting.

Enabled pcap filter optimiization and everything is fine.

@solariz

This comment has been minimized.

Show comment
Hide comment
@solariz

solariz Jan 14, 2017

Owner

Got a strange behavior here, sometimes on a debian machine pcap did not return -1 as required

Owner

solariz commented on sdh-proxy.c in 1f70fda Jan 14, 2017

Got a strange behavior here, sometimes on a debian machine pcap did not return -1 as required

void writeLogStats()
{
// don't spam! just write the log once every X seconds
if((logtimer + 10) < (int)time(NULL)) {

This comment has been minimized.

@sirsquidness

sirsquidness Jan 16, 2017

Collaborator

I think this is missing the value being update after each loop (eg, logtimer = time(NULL)), so this will run every time a packet is forwarded?

@sirsquidness

sirsquidness Jan 16, 2017

Collaborator

I think this is missing the value being update after each loop (eg, logtimer = time(NULL)), so this will run every time a packet is forwarded?

This comment has been minimized.

@solariz

solariz Jan 17, 2017

Contributor

Actually it is missing but somehow it run correctly :) Will check.

@solariz

solariz Jan 17, 2017

Contributor

Actually it is missing but somehow it run correctly :) Will check.

if (fp)
{
// General Stats
fprintf(fp,"## GENERAL\nRX:%ld\nTX:%ld\nDROP:%ld\n## PORT STATS\n",(long) pkt_rx, (long) pkt_tx, (long) pkt_drop);

This comment has been minimized.

@sirsquidness

sirsquidness Jan 16, 2017

Collaborator

Does your use case with influxDB support single line entries? I'd prefer single line entries (eg, CSV, JSON, or similar) so that it's more of a traditional log, but I don't mind leaving this as is if you can't use single line :)

@sirsquidness

sirsquidness Jan 16, 2017

Collaborator

Does your use case with influxDB support single line entries? I'd prefer single line entries (eg, CSV, JSON, or similar) so that it's more of a traditional log, but I don't mind leaving this as is if you can't use single line :)

This comment has been minimized.

@solariz

solariz Jan 17, 2017

Contributor

I choose this way of logfile because it'S still human readable. For pushing it to influxDB I used a sperate bash Script to convert this into a one line insert every 10s.

@solariz

solariz Jan 17, 2017

Contributor

I choose this way of logfile because it'S still human readable. For pushing it to influxDB I used a sperate bash Script to convert this into a one line insert every 10s.

This comment has been minimized.

@solariz

solariz Jan 18, 2017

Contributor

I put the Bash Script I'm using to pusinh this stats into a influxDB at gist:
https://gist.github.com/solariz/29362abbcf45605ab700df6f6e6be141

It's pretty simple, influx can handle a huge amount of posts per second so we're totally fine with that currently. On the last event the influx run on a raspberry pi at a mean CPU cycle of less then 10% :)

@solariz

solariz Jan 18, 2017

Contributor

I put the Bash Script I'm using to pusinh this stats into a influxDB at gist:
https://gist.github.com/solariz/29362abbcf45605ab700df6f6e6be141

It's pretty simple, influx can handle a huge amount of posts per second so we're totally fine with that currently. On the last event the influx run on a raspberry pi at a mean CPU cycle of less then 10% :)

Show outdated Hide outdated sdh-proxy.c
Show outdated Hide outdated sdh-proxy.c
@sirsquidness

This comment has been minimized.

Show comment
Hide comment
@sirsquidness

sirsquidness Jan 16, 2017

Collaborator

Thank you so much for submitting this PR! It's so exciting to know that Dreamhack used something I wrote :D

I am happy to merge this PR as is, but I left a few comments to get your thoughts.

And thanks especially for the BPF optimisation thing - I had that problem last time I used it, and worked around by running multiple instances of the app. This is a much nicer solution :)

Collaborator

sirsquidness commented Jan 16, 2017

Thank you so much for submitting this PR! It's so exciting to know that Dreamhack used something I wrote :D

I am happy to merge this PR as is, but I left a few comments to get your thoughts.

And thanks especially for the BPF optimisation thing - I had that problem last time I used it, and worked around by running multiple instances of the app. This is a much nicer solution :)

@mintopia

This comment has been minimized.

Show comment
Hide comment
@mintopia

mintopia Jan 16, 2017

We've been using it at epic.LAN for over a year now as well. Thanks adding the extra games to it as well. I'm looking forward to getting some stats from our next event!

mintopia commented Jan 16, 2017

We've been using it at epic.LAN for over a year now as well. Thanks adding the extra games to it as well. I'm looking forward to getting some stats from our next event!

+ Changed counter int32 to 64
+ Added logtimer update to run properly every loop
@solariz

This comment has been minimized.

Show comment
Hide comment
@solariz

solariz Jan 26, 2017

Contributor

Hey, pushed back latest fixes. Guess I'm out for now until next LAN :)

Ready for Merge 👍

Contributor

solariz commented Jan 26, 2017

Hey, pushed back latest fixes. Guess I'm out for now until next LAN :)

Ready for Merge 👍

@sirsquidness sirsquidness merged commit b7d7a1b into OpenSourceLAN:master Jan 28, 2017

@sirsquidness

This comment has been minimized.

Show comment
Hide comment
@sirsquidness

sirsquidness Jan 28, 2017

Collaborator

Merged! Thanks again, both for finding the tool useful and for contributing back :)

Collaborator

sirsquidness commented Jan 28, 2017

Merged! Thanks again, both for finding the tool useful and for contributing back :)

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