Linux increases OpenFire concurrency (online collection)

Source: Internet
Author: User

Google Blog Address: http://tsaiquinn.blogspot.com/2014/10/linuxopenfire.html

The elements that affect the number of connections contain three types:
1) Linux system parameters
2) The number of threads that the process itself can create
3) OpenFire self-system parameters

Linux system parameters
1.ulimit–n 265535
On a Linux platform, regardless of whether you write a client or a service-side program, the highest concurrency is limited by the number of files that can be opened by the system at the same time as the user's single process (because the system creates a socket handle for each TCP connection) for high concurrent TCP connection processing. Each socket handle is also a file handle, which can be set to a larger number. This command is a temporary change or can be modified by modifying the file/etc/security/limits.conf
2.net.ipv4.ip_conntrack_max=265535
Maximum tracking connection entry allowed by the system. Add this property to the/etc/sysctl.conf file and run the >/sbin/sysctl.conf–p
Also in the sysctl-p when a reported error: ' Net.ipv4.ip_conntrack_max ' is an unknown key, fixed by the following command:
Modprobe Ip_conntrack
echo "Modprobe ip_conntrack" >>/etc/rc.local
3.fs.file-max = 265535
The number of file handles that can be opened at the system level, Ulimit is the process level
4.kernel.threads-max=265535
Maximum number of threads that the system can generate
5.vm.max_map_count=265535
Defines the maximum number of memory areas a process can have
6. Other parameters can be set as follows:
Net.ipv4.conf.default.rp_filter = 1
Net.ipv4.conf.default.accept_source_route = 0
KERNEL.SYSRQ = 0
Kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 0
KERNEL.MSGMNB = 265536
Kernel.msgmax = 265536
Kernel.shmmax = 68719476736
Kernel.shmall = 4294967296
Net.ipv4.tcp_max_tw_buckets = 6000
Net.ipv4.tcp_sack = 0
net.ipv4.tcp_window_scaling = 1
Net.ipv4.tcp_rmem = 4096 87380 4194304
Net.ipv4.tcp_wmem = 4096 16384 4194304
Net.core.wmem_default = 8388608
Net.core.rmem_default = 8388608
Net.core.rmem_max = 16777216
Net.core.wmem_max = 16777216
Net.core.netdev_max_backlog = 262144
Net.core.somaxconn = 262144
Net.ipv4.tcp_max_orphans = 3276800
Net.ipv4.tcp_max_syn_backlog = 262144
Net.ipv4.tcp_timestamps = 0
Net.ipv4.tcp_synack_retries = 2
Net.ipv4.tcp_syn_retries = 2
Net.ipv4.tcp_syn_retries = 1
Net.ipv4.tcp_tw_recycle = 1
Net.ipv4.tcp_tw_reuse = 1
Net.ipv4.tcp_mem = 94500000 915000000 927000000
Net.ipv4.tcp_fin_timeout = 1
Net.ipv4.tcp_keepalive_time = 1200
Net.ipv4.ip_local_port_range = 1024 60000
Net.ipv4.tcp_window_scaling=0
Net.ipv4.tcp_no_metrics_save=1

JVM parameters
The maximum number of generators that can be generated in a JVM is affected by the JVM's heap memory size, thread's stack memory size, and the maximum number of threads that can be created by the system: three.
(maxprocessmemory-jvmmemory-reservedosmemory)/(Threadstacksize) = number of threads
Maxprocessmemory refers to the maximum memory of a process
Jvmmemory JVM Memory
Reservedosmemory reserved Operating system memory
Size of the Threadstacksize line stacks

OpenFire System Properties
cache.username2roster.size:12000000
cache.group.size:40000000
cache.usercache.size:35000000
cache.lastactivity.size:1500000
cache.offlinepresence.size:1500000

Linux increases OpenFire concurrency (online collection)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.