Skip to content

Instantly share code, notes, and snippets.

@itbcodedev
Forked from mustafaturan/network-tweak.md
Created December 12, 2019 08:10
Show Gist options
  • Select an option

  • Save itbcodedev/d51b35efb20b090e8d677341201e9e4d to your computer and use it in GitHub Desktop.

Select an option

Save itbcodedev/d51b35efb20b090e8d677341201e9e4d to your computer and use it in GitHub Desktop.

Revisions

  1. Mustafa TURAN revised this gist Mar 4, 2018. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion network-tweak.md
    Original file line number Diff line number Diff line change
    @@ -52,4 +52,9 @@ Additional files in /etc/security/limits.d/ might affect what is configured in l
    - http://docs.basho.com/riak/kv/2.2.1/using/performance/#optional-i-o-settings
    - http://docs.basho.com/riak/kv/2.2.1/using/performance/open-files-limit/#enable-pam-based-limits-for-centos-and-red-hat
    - http://docs.basho.com/riak/kv/2.2.1/using/performance/amazon-web-services/
    - http://docs.basho.com/riak/kv/2.2.1/using/performance/erlang/
    - http://docs.basho.com/riak/kv/2.2.1/using/performance/erlang/

    ### Talks

    - https://youtu.be/TneLO5TdW_M
    - https://www.slideshare.net/iXsystems/rick-reed-600-m-unsuspecting-freebsd-users
  2. Mustafa TURAN revised this gist Mar 28, 2017. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion network-tweak.md
    Original file line number Diff line number Diff line change
    @@ -45,4 +45,11 @@ Additional files in /etc/security/limits.d/ might affect what is configured in l

    [2] - https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php

    [3] - http://stackoverflow.com/questions/11342167/how-to-increase-ulimit-on-amazon-ec2-instance
    [3] - http://stackoverflow.com/questions/11342167/how-to-increase-ulimit-on-amazon-ec2-instance

    ### More Reading

    - http://docs.basho.com/riak/kv/2.2.1/using/performance/#optional-i-o-settings
    - http://docs.basho.com/riak/kv/2.2.1/using/performance/open-files-limit/#enable-pam-based-limits-for-centos-and-red-hat
    - http://docs.basho.com/riak/kv/2.2.1/using/performance/amazon-web-services/
    - http://docs.basho.com/riak/kv/2.2.1/using/performance/erlang/
  3. Mustafa TURAN revised this gist Mar 23, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions network-tweak.md
    Original file line number Diff line number Diff line change
    @@ -42,5 +42,7 @@ Additional files in /etc/security/limits.d/ might affect what is configured in l
    ### References

    [1] - https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/sect-Oracle_9i_and_10g_Tuning_Guide-Adjusting_Network_Settings-Changing_Network_Kernel_Settings.html

    [2] - https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php

    [3] - http://stackoverflow.com/questions/11342167/how-to-increase-ulimit-on-amazon-ec2-instance
  4. Mustafa TURAN revised this gist Mar 23, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion network-tweak.md
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ Changing values through the ulimit command only applies to the current shell ses
    * soft nofile 20000
    * hard nofile 20000
    ```
    Save the file, log-out, log-in again and test the configuration through the ulimit -n command. Hope it helps.
    Save the file, log-out, log-in again and test the configuration through the ulimit -n command.

    Keep the following in mind:

  5. Mustafa TURAN revised this gist Mar 23, 2017. 1 changed file with 19 additions and 1 deletion.
    20 changes: 19 additions & 1 deletion network-tweak.md
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,25 @@
    sysctl -w net.core.wmem_max=16384
    ```

    Changing values through the ulimit command only applies to the current shell session, So if you want to set a new limit permanently, edit the /etc/security/limits.conf file and set your hard and soft limits. Here's an example:

    ```
    # <domain> <type> <item> <value>
    * soft nofile 20000
    * hard nofile 20000
    ```
    Save the file, log-out, log-in again and test the configuration through the ulimit -n command. Hope it helps.

    Keep the following in mind:

    Soft limit: value that the kernel enforces for the corresponding resource.
    Hard limit: works as a ceiling for the soft limit.
    Additional files in /etc/security/limits.d/ might affect what is configured in limits.conf.



    ### References

    [1] - https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/sect-Oracle_9i_and_10g_Tuning_Guide-Adjusting_Network_Settings-Changing_Network_Kernel_Settings.html
    [2] - https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php
    [2] - https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php
    [3] - http://stackoverflow.com/questions/11342167/how-to-increase-ulimit-on-amazon-ec2-instance
  6. Mustafa TURAN revised this gist Mar 11, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions network-tweak.md
    Original file line number Diff line number Diff line change
    @@ -23,5 +23,6 @@
    ```

    ### References
    [1]: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/sect-Oracle_9i_and_10g_Tuning_Guide-Adjusting_Network_Settings-Changing_Network_Kernel_Settings.html
    [2]: https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php

    [1] - https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/sect-Oracle_9i_and_10g_Tuning_Guide-Adjusting_Network_Settings-Changing_Network_Kernel_Settings.html
    [2] - https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php
  7. Mustafa TURAN created this gist Mar 11, 2017.
    27 changes: 27 additions & 0 deletions network-tweak.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    # Sample config for 2 million web socket connection

    ```shell
    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds
    sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'

    # Set the receive buffer for each TCP connection with minumum, default and maximum thresholds
    sysctl -w net.ipv4.tcp_rmem='1024 4096 16384'

    # Set the TCP send buffer space with minumum, default and maximum thresholds
    sysctl -w net.ipv4.tcp_wmem='1024 4096 16384'

    # The maximum socket receive buffer sizemem_max=16384
    sysctl -w net.core.rmem_max=16384

    # The maximum socket send buffer size
    sysctl -w net.core.wmem_max=16384
    ```

    ### References
    [1]: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/sect-Oracle_9i_and_10g_Tuning_Guide-Adjusting_Network_Settings-Changing_Network_Kernel_Settings.html
    [2]: https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php