How to adjust socket descriptors?

后端 未结 5 720
盖世英雄少女心
盖世英雄少女心 2021-02-02 11:15

\"enter

I want to know who to adjust quantity of the socket descriptors?

In additi

5条回答
  •  爱一瞬间的悲伤
    2021-02-02 11:57

    The solution which worked for me on Ubuntu is this:

    First, find the correct rabbitmq-server file. You can do this by running locate rabbitmq-server on the bash prompt.
    Then open the file with sudo vim /etc/default/rabbitmq-server. It is a file which will contain the line ulimit -n 4096.
    If the line is commented out with a #, uncomment the line.
    Then add EOF as the last line of the file.

    The file will now appear like this:

    # This file is sourced by /etc/init.d/rabbitmq-server. Its primary
    # reason for existing is to allow adjustment of system limits for the
    # rabbitmq-server process.
    #
    # Maximum number of open file handles. This will need to be increased
    # to handle many simultaneous connections. Refer to the system
    # documentation for ulimit (in man bash) for more information.
    #
    ulimit -n 4096
    EOF
    

    Now you have to restart rabbitmq. Don't restart the operating system though.
    Locate your rabbitmqctl file and run:
    sudo /usr/sbin/rabbitmqctl stop
    Then start rabbitmq again either with sudo /usr/sbin/rabbitmqctl start &.

    That's it. Now go to the RabbitMQ Browser UI, and you'll see that the number of sockets have increased.

提交回复
热议问题