I am getting - WARNING: This is a development server

I have setup ERPNext for production but when I use bench start I am getting the following:

13:41:22 system        | redis_cache.1 started (pid=2403)
13:41:22 system        | web.1 started (pid=2408)
13:41:22 system        | redis_queue.1 started (pid=2405)
13:41:22 system        | worker.1 started (pid=2421)
13:41:22 redis_cache.1 | 2409:C 02 Dec 2023 13:41:22.053 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
13:41:22 redis_queue.1 | 2415:C 02 Dec 2023 13:41:22.053 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
13:41:22 redis_cache.1 | 2409:C 02 Dec 2023 13:41:22.053 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=2409, just started
13:41:22 redis_queue.1 | 2415:C 02 Dec 2023 13:41:22.053 # Redis version=6.0.16, bits=64, commit=00000000, modified=0, pid=2415, just started
13:41:22 redis_queue.1 | 2415:C 02 Dec 2023 13:41:22.053 # Configuration loaded
13:41:22 redis_cache.1 | 2409:C 02 Dec 2023 13:41:22.053 # Configuration loaded
13:41:22 redis_queue.1 | 2415:M 02 Dec 2023 13:41:22.054 * Increased maximum number of open files to 10032 (it was originally set to 1024).
13:41:22 system        | schedule.1 started (pid=2417)
13:41:22 system        | socketio.1 started (pid=2411)
13:41:22 redis_cache.1 | 2409:M 02 Dec 2023 13:41:22.055 * Increased maximum number of open files to 10032 (it was originally set to 1024).
13:41:22 redis_queue.1 | 2415:M 02 Dec 2023 13:41:22.056 * Running mode=standalone, port=11000.
13:41:22 redis_cache.1 | 2409:M 02 Dec 2023 13:41:22.056 * Running mode=standalone, port=13000.
13:41:22 redis_queue.1 | 2415:M 02 Dec 2023 13:41:22.057 # Server initialized
13:41:22 redis_queue.1 | 2415:M 02 Dec 2023 13:41:22.057 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
13:41:22 redis_cache.1 | 2409:M 02 Dec 2023 13:41:22.057 # Server initialized
13:41:22 redis_queue.1 | 2415:M 02 Dec 2023 13:41:22.057 * Ready to accept connections
13:41:22 redis_cache.1 | 2409:M 02 Dec 2023 13:41:22.057 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
13:41:22 redis_cache.1 | 2409:M 02 Dec 2023 13:41:22.058 * Ready to accept connections
13:41:22 system        | watch.1 started (pid=2414)
13:41:22 socketio.1    | Realtime service listening on:  9000
13:41:24 watch.1       |
13:41:25 watch.1       | yarn run v1.22.19
13:41:25 watch.1       | $ node esbuild --watch --live-reload
13:41:25 web.1         | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

Here the log output that concerns me is:
13:41:22 redis_queue.1 | 2415:M 02 Dec 2023 13:41:22.057 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
Do I have to do this?

Another one is:
13:41:25 web.1 | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
How to solve this Warning? Will it affect performance of ERPNext under heavy usage?

That means it is in development mode.

You need to configure it in production mode by following tutorials available on official website

I can’t use sudo bench setup production because this is running on our local server in our LAN and thus it does not have any domain.

And the I have used bench set-config developer_mode 0 so that developer mode is off.

Yes, when ERPNext is running this way, there is only 1 web server thread. So only 1 HTTP request can be processed at a time. There are a few other performance impacts, such as lower performance when serving static content.

To truly run ERPNext in a production environment, you would never run “bench start” in your terminal.
Instead, ERPNext would run under the Supervisor process control system. At the same time, you would have Nginx configured as a reverse proxy.

NOTE: The “Developer Mode” configured with set-config developer_mode 0 is a completely different thing. Despite its (confusing) name, it actually has nothing to do with Development environment vs. Production environment. Instead, this “Developer Mode” just enables/disables a few features (like the ability to edit DocTypes)

4 Likes

Does this mean that we cannot run ERPNext locally in Production mode?

The client wants to run ERPNext locally inside their network with on access to the web.

In this case how should I setup ERPNext to work in Production mode?

I installed it locally as a standalone, however I used the docker container rather than on bare metal

Thanks for the docker link. But I do not plan to setup and use ERPNext via Docker.

What I want to do is setup a Production server and access it locally within the local area network of 4 PCs connected to a server.

If I’m not mistaken, the approach / configuration is identical whether on bear metal or Docker image. Both should be capable of achieving your requirement.

Even if it is running in a local server without a domain, you should still be able to do bench setup production.
Or try bench setup supervisor and bench setup nginx as shown here
https://frappeframework.com/docs/user/en/bench/guides/setup-production

1 Like