Ok I just set it to 6 workers (as I have a Linode 8096: 8 GB RAM, 6 CPU Cores, 192 GB SSD Storage https://www.linode.com/pricing)
env:
LANG: en_US.UTF-8
## TODO: How many concurrent web requests are supported?
## With 2GB we recommend 3-4 workers, with 1GB only 2
UNICORN_WORKERS: 6
##
## TODO: List of comma delimited emails that will be made admin and developer
## on initial signup example 'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'hello@nomadlist.io'
##
## TODO: The domain name this Discourse instance will respond to
DISCOURSE_HOSTNAME: 'nomadforum.io'
##
Then I rebuild it: /var/discourse/launcher rebuild app
Which took a few minutes and then it was up again. But I’m still getting timeouts:
2015/11/11 22:33:24 [error] 11980#0: *19753 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 110.139.184.21, server: nomadforum.io, request: "POST /message-bus/8bd73af468ec44a2ae75ec6534a44696/poll? HTTP/1.1", upstream: "http://127.0.0.1:4578/message-bus/8bd73af468ec44a2ae75ec6534a44696/poll?", host: "nomadforum.io", referrer: "https://nomadforum.io/t/how-to-make-a-macbook-air-ergonomic/5090"
2015/11/11 22:33:27 [error] 11985#0: *23174 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 201.37.160.13, server: nomadforum.io, request: "POST /message-bus/f8bab6397d4b46bca04f91664627c7e9/poll? HTTP/1.1", upstream: "http://127.0.0.1:4578/message-bus/f8bab6397d4b46bca04f91664627c7e9/poll?", host: "nomadforum.io", referrer: "https://nomadforum.io/t/can-you-create-a-foreign-company-and-hire-yourself-as-an-employee/5172"
2015/11/11 22:33:39 [error] 11980#0: *19753 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 110.139.184.21, server: nomadforum.io, request: "POST /message-bus/8bd73af468ec44a2ae75ec6534a44696/poll? HTTP/1.1", upstream: "http://127.0.0.1:4578/message-bus/8bd73af468ec44a2ae75ec6534a44696/poll?", host: "nomadforum.io", referrer: "https://nomadforum.io/t/how-to-make-a-macbook-air-ergonomic/5090"
2015/11/11 22:33:47 [error] 11985#0: *23174 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 201.37.160.13, server: nomadforum.io, request: "POST /message-bus/f8bab6397d4b46bca04f91664627c7e9/poll? HTTP/1.1", upstream: "http://127.0.0.1:4578/message-bus/f8bab6397d4b46bca04f91664627c7e9/poll?", host: "nomadforum.io", referrer: "https://nomadforum.io/t/can-you-create-a-foreign-company-and-hire-yourself-as-an-employee/5172"
Any idea how I can debug this further? Here’s a (filtered) print from my htop. At least I’m seeing 6 workers now, that’s good:
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
18587 nobody 20 0 394M 83116 65048 S 11.8 1.0 0:08.59 php-fpm: pool www
4432 mysql 20 0 3372M 83032 0 S 0.7 1.0 4:08.74 /usr/sbin/mysqld
4436 mysql 20 0 3372M 83032 0 S 0.0 1.0 3:00.56 /usr/sbin/mysqld
4224 mysql 20 0 3372M 83032 0 S 0.0 1.0 3h02:41 /usr/sbin/mysqld
11985 www-data 20 0 117M 34704 4608 S 1.3 0.4 0:12.70 nginx: worker process
22228 www-data 20 0 118M 4472 2784 S 0.7 0.1 0:00.44 nginx: worker process
22230 www-data 20 0 119M 4844 2932 S 0.0 0.1 0:00.86 nginx: worker process
22349 pymcrdkib 20 0 466M 215M 10280 S 0.0 2.7 0:14.37 unicorn worker[0] -E production -c config/unicorn.conf.rb
22766 pymcrdkib 20 0 464M 216M 10160 S 0.0 2.7 0:11.96 unicorn worker[1] -E production -c config/unicorn.conf.rb
22899 pymcrdkib 20 0 462M 217M 10032 S 0.7 2.7 0:12.13 unicorn worker[2] -E production -c config/unicorn.conf.rb
23241 pymcrdkib 20 0 462M 216M 10108 S 0.7 2.7 0:12.58 unicorn worker[3] -E production -c config/unicorn.conf.rb
23603 pymcrdkib 20 0 1020M 228M 15668 S 1.3 2.9 0:13.10 unicorn worker[4] -E production -c config/unicorn.conf.rb
23809 pymcrdkib 20 0 414M 171M 9752 S 0.7 2.1 0:11.15 unicorn worker[5] -E production -c config/unicorn.conf.rb
22327 pymcrdkib 20 0 1294M 272M 15704 S 0.0 3.4 0:41.49 sidekiq 3.5.0 discourse [0 of 5 busy]
22308 pymcrdkib 20 0 1294M 272M 15704 S 0.0 3.4 5:16.87 sidekiq 3.5.0 discourse [0 of 5 busy]
22238 messagebu 20 0 377M 10768 9384 S 0.0 0.1 0:00.43 postgres: wal writer process
3382 root 20 0 67900 8 4 S 0.0 0.0 0:00.00 su couchdb -c /usr/bin/couchdb
22210 mysql 20 0 173M 139M 2692 S 0.0 1.7 0:18.25 /usr/bin/redis-server *:6379
16603 root 20 0 134M 18948 4196 S 0.0 0.2 5:33.98 /usr/bin/irssi
18570 nobody 20 0 437M 75224 16592 S 0.0 0.9 0:11.23 php-fpm: pool www
18718 nobody 20 0 429M 96024 44976 S 0.0 1.2 0:03.55 php-fpm: pool www
Load average: load average: 0.77 1.11 1.49
Seems OK too. Can I optimize something else?