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

Sharing my initial config #50

Closed
ric79 opened this Issue Jul 13, 2017 · 5 comments

Comments

Projects
None yet
5 participants
@ric79

ric79 commented Jul 13, 2017

This is not an issue. I'm just sharing my initial config for ubuntu 16 LTS

> sudo apt-get install apache2 php libapache2-mod-php php-mcrypt

# KeepAlive on Apache
> more /etc/apache2/apache2.conf | grep "KeepAlive On"
  KeepAlive On

# Modify PHP
> sudo more /etc/php/7.0/apache2/php.ini
  ...
  max_execution_time = 90
  max_input_time = 90
  memory_limit = 128M
  post_max_size = 50M
  upload_max_filesize = 50M
  ...

# Modify TCP  
> sudo more /etc/sysctl.conf  
  ...
  net.core.wmem_max = 16777216
  net.ipv4.tcp_window_scaling = 1
  net.ipv4.tcp_rmem = 4096 87380 16777216
  net.ipv4.tcp_wmem = 2096 65535 16777216
  net.ipv4.tcp_mem = 98304 131072 196608
  net.core.netdev_max_backlog = 250000
  net.ipv4.tcp_timestamps = 1
  net.ipv4.ip_local_port_range = 1025 61000
  net.ipv4.tcp_congestion_control=htcp
  ...
> sudo sysctl -p

# Transmit Queue Length
# Add at then end
> nano /etc/rc.local
  /sbin/ifconfig eth0 txqueuelen 10000

> ifconfig
  eth0   Link encap:Ethernet  HWaddr fa:b5:d4:b7:8f:1e
            inet addr:xxx.xxx.62.103  Bcast:xxx.xxx.62.255  Mask:255.255.255.0
            inet6 addr: fe80::f8b5:d4ff:feb7:8f1e/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:298 errors:0 dropped:15 overruns:0 frame:0
            TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:10000
            RX bytes:36593 (36.5 KB)  TX bytes:17182 (17.1 KB)

Riccardo

adolfintel added a commit that referenced this issue Jul 13, 2017

@adolfintel

This comment has been minimized.

Owner

adolfintel commented Jul 13, 2017

Thanks, I've added a link to this in the readme

@adolfintel adolfintel closed this Jul 13, 2017

dotsam added a commit to dotsam/speedtest that referenced this issue Jul 28, 2017

Merge 4.2.8
* upstream/master:
  Updated doc.md
  add support to disable specific tests when pass "-1" (#52)
  The time limits are now ignored if the speed is still 0.00 when the limit is reached
  Added link to #50
  Updated known issues
  Added more troubleshooting
  Added donation info
  Updated README.md
  Removed unused Fetch API support (may come back in future); Removed quirk for Safari, now treated as chromium-based browser
  Added quickstart videos
  Improved custom settings parsing
  Added more common issues in troubleshooting section of doc.md
  Added warning if parsing of custom settings fails
  Added customizable grace time at beginning of tests; GET parameters can now be used in the URLs in the settings; Minor changes
  Fixed a typo in IE11-specific code
  Added configuration for custom compensation factor; Fixed a problem where xhr_ignoreErrors could not be changed
  Improved ping/jitter test
  Added options for managing errors during test (abort/retry/ignore)
@claytondukes

This comment has been minimized.

claytondukes commented Nov 28, 2017

Here's a setup script for Ubuntu:

#!/bin/bash
apt update
apt-get install apache2 php libapache2-mod-php php-mcrypt
grep -q "KeepAlive On" /etc/apache2/apache2.conf || { echo "KeepAlive On" >> /etc/apache2/apache2.conf; service apache2 restart; }
perl -i -pe 's/max_execution_time = \d+/max_execution_time = 90/' /etc/php/7.0/apache2/php.ini
perl -i -pe 's/max_input_time = \d+/max_input_time = 90/' /etc/php/7.0/apache2/php.ini
perl -i -pe 's/memory_limit = \S+/memory_limit = 128M/' /etc/php/7.0/apache2/php.ini
perl -i -pe 's/post_max_size = \S+/post_max_size = 50M/' /etc/php/7.0/apache2/php.ini
perl -i -pe 's/upload_max_filesize = \S+/upload_max_filesize = 50M/' /etc/php/7.0/apache2/php.ini

grep -q "net.core.wmem_max = 16777216" /etc/sysctl.conf || echo "net.core.wmem_max = 16777216" >> /etc/sysctl.conf
grep -q "net.ipv4.tcp_window_scaling = 1" /etc/sysctl.conf || echo "net.ipv4.tcp_window_scaling = 1" >> /etc/sysctl.conf
grep -q "net.ipv4.tcp_rmem = 4096 87380 16777216" /etc/sysctl.conf || echo "net.ipv4.tcp_rmem = 4096 87380 16777216" >> /etc/sysctl.conf
grep -q "net.ipv4.tcp_wmem = 2096 65535 16777216" /etc/sysctl.conf || echo "net.ipv4.tcp_wmem = 2096 65535 16777216" >> /etc/sysctl.conf
grep -q "net.ipv4.tcp_mem = 98304 131072 196608" /etc/sysctl.conf || echo "net.ipv4.tcp_mem = 98304 131072 196608" >> /etc/sysctl.conf
grep -q "net.core.netdev_max_backlog = 250000" /etc/sysctl.conf || echo "net.core.netdev_max_backlog = 250000" >> /etc/sysctl.conf
grep -q "net.ipv4.tcp_timestamps = 1" /etc/sysctl.conf || echo "net.ipv4.tcp_timestamps = 1" >> /etc/sysctl.conf
grep -q "net.ipv4.ip_local_port_range = 1025 61000" /etc/sysctl.conf || echo "net.ipv4.ip_local_port_range = 1025 61000" >> /etc/sysctl.conf
grep -q "net.ipv4.tcp_congestion_control=htcp" /etc/sysctl.conf || echo "net.ipv4.tcp_congestion_control=htcp" >> /etc/sysctl.conf
sysctl -p >/dev/null

netIF=$(ifquery --list | grep -v lo | head -1)
if [[ -z "${netIF}" ]]; then
    echo "Unable to get your ethernet interface using 'ifquery --list | grep -v lo | head -1'"
    echo "Please add '/sbin/ifconfig <whatetever your local network interface name is> txqueuelen 10000' to your '/etc/rc.local' file and reboot"
    exit 1
else
    grep -q "/sbin/ifconfig ${netIF} txqueuelen 10000" /etc/rc.local || { echo "/sbin/ifconfig ${netIF} txqueuelen 10000" >> /etc/rc.local; /sbin/ifconfig ${netIF} txqueuelen 10000; }
fi

echo "If no errors appear here, you're good to go"
echo "Follow the setup instructions at https://github.com/adolfintel/speedtest/blob/master/doc.md for the rest"
@adolfintel

This comment has been minimized.

Owner

adolfintel commented Nov 29, 2017

Thanks for the script 👍

@hackzilla

This comment has been minimized.

hackzilla commented Jan 8, 2018

@claytondukes

I've just tried your script, and generally it works well.
However, with the rc.local, the line appears after the exit 0, which I think it needs to go before.

@baantunes

This comment has been minimized.

baantunes commented Jul 2, 2018

@hackzilla @claytondukes

Assuming that "exit 0" will always be the last line:

Remove last line
sed -i '$ d' /etc/rc.local;

Add Transmit Queue Length
echo "/sbin/ifconfig ${netIF} txqueuelen 10000" >> /etc/rc.local;

Add exit 0
echo "exit 0" >> /etc/rc.local;

Or in one line:
grep -q "/sbin/ifconfig ${netIF} txqueuelen 10000" /etc/rc.local || { sed -i '$ d' /etc/rc.local; echo "/sbin/ifconfig ${netIF} txqueuelen 10000" >> /etc/rc.local; echo "exit 0" >> /etc/rc.local; /sbin/ifconfig ${netIF} txqueuelen 10000; }

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