Pycharm – Watch limit size increase

For an intelligent IDE, it is essential to be in the know about any external changes in files it is working with – e.g. changes made by VCS, or build tools, or code generators etc. For that reason, IntelliJ platform spins background process to monitor such changes. The method it uses is platform-specific, and on Linux, it is the Inotify facility.

Inotify requires a “watch handle” to be set for each directory in the project. Unfortunately, the default limit of watch handles may not be enough for reasonably sized projects, and reaching the limit will force IntelliJ platform to fall back to recursive scans of directory trees.

To prevent this situation it is recommended to increase the watches limit (to, say, 512K):

1. Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:

fs.inotify.max_user_watches = 524288

2. Then run this command to apply the change:

sudo sysctl -p --system

And don’t forget to restart your IDE.

Note: the watches limit is per-account setting. If there are other programs running under the same account which also uses Inotify the limit should be raised high enough to suit needs of all of them.

Docker – uwsgi – nginx – Django

 1. Assume
– Docker is already installed [Link]
– Django & it’s project is ready [Link]
– Postgres or MySQL is ready [Link]
– Python3
– CentOS 7

  2. Install Packages

yum install uwsgi
yum install nginx

 3. Create Uwsgi conf file
– Location : doesn’t matter , where you want..
– Name : whatever you want (*.ini)

[uwsgi]
project = firstsite
base = /home/user

chdir = %(base)/%(project)
home = %(base)/Env/%(project)
module = %(project).wsgi:application

master = true
processes = 5

socket = %(base)/%(project)/%(project).sock
chmod-socket = 664
vacuum = true

 4. Run Uwsgi

uwsgi ./<*.ini file> --emperor <Django Project Home> &

 5. Edit Nginx conf file
– Location : /etc/nginx/nginx.conf

server {
    listen <port>;
    server_name <servername>;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/dev/<project>/<project>/static;
    }

    location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/home/dev/<project>/<project>.sock;
    }
}

 6. Run Nginx

/usr/sbin/nginx

 7. Test

http://<ip>:<port>