Scaling WebSocket

When you deploy Access Gateway for a large scale WebSocket environment and the expected concurrent users accessing the WebSocket application is more than normal, it is recommended to tune Access Gateway to handle large scale requests.

To tune Access Gateway, edit the following files:

  1. httpd-mpm.conf: Modify mpm_worker_module based on the number of expected concurrent users. This tunes the number of threads of Access Gateway.

  2. novell-apache2: To increase the number of open files for apache, increase the value of ulimit. Use the command ulimit -n [new limit].

    To set a temporary value, run the command using a terminal window. To set a permanent value, make the changes in the /etc/init.d/novell-apache2 file. If the server uses systemd, then you need to make changes in /etc/systemd/system/novell-apache2.service.

For example, you can scale WebSocket connections up to 25000 connections by performing the following steps:

  1. In the httpd-mpm.conf file, make the following changes to mpm_worker_module:

    <IfModule mpm_worker_module>
        ThreadLimit        3000
        StartServers          9
        ServerLimit          10
        MaxClients         30000
        MinSpareThreads    9000
        MaxSpareThreads    9000
        ThreadsPerChild    3000
        MaxRequestsPerChild   0
    </IfModule>

    For information about how to edit a file, see Modifying Configurations.

  2. In the /etc/init.d/novell-apache2 file, set the ulimit value to 8192 by using the command ulimit -n 8192.

    NOTE:If the server uses systemd, make the required changes under the Service section in the /etc/systemd/system/novell-apache2.service file.

    The following is an example snippet:

    [Service]
    LimitNOFILE=20000
    Type=oneshot
    EnvironmentFile=/etc/opt/novell/apache2/conf/.arg_file
    Environment="LD_LIBRARY_PATH=/opt/novell/ssllib:/opt/novell/openssl/lib"
    ExecStart=/opt/novell/apache2/sbin/httpd $ARGL
    ExecStop=/opt/novell/apache2/sbin/httpd -k stop
    ExecReload=/opt/novell/apache2/sbin/httpd -k graceful
    RemainAfterExit=yes
    TasksMax=28000
  3. Restart Apache.

    If you have modified the /etc/init.d/novell-apache2 file, run the following command:

    /etc/init.d/novell-apache2 restart OR systemctl restart novell-apache2.service

    If you have modified the /etc/systemd/system/novell-apache2.service file, run the following commands:

    • systemctl daemon-reload

    • systemctl restart novell-apache2.service

    For the Docker deployment, perform the following steps:

    1. Run the kubectl get pods command to view the Access Manager pods.

    2. Go to the Access Gateway pod by running the kubectl exec --namespace <name-of-the-namespace> -it pod/<name-of-the-access-gateway-pod> -- sh command.

    3. Run the /etc/init.d/novell-mag restart or systemctl restart novell-mag.service command.