mirror of
https://github.com/novatiq/packages.git
synced 2026-07-30 15:23:07 +01:00
uwsgi-cgi: General cleanup
* Remove stray LICENSE file added to repo * Use codeload instead of git * Add proper (as close as possible) SPDX license * Drop OpenSSL, PCRE and Libxml2 as dependencies Makes it more suitable alternative for small flash devices * Drop /etc/uwsgi as there's only one config file * Remove stray /etc/nginx directory * Reorganize configuration file * Convert init.d script to use procd * Hardset 3 threads and processes, seems like a good tradeoff between performance and memory usage instead of doing auto scaling based on amout of cpu cores/threads Non-scientific benchmark (tm) ramips, mt7621, WiTi Board 16/256M 1. 3 threads, 6 processes 2. 2 threads, 2 processes 3. 3 threads, 3 processes - LuCI Main page 1.48s 1.72s 1.64s - Status --> Firewall 6.24s 6.39s 6.40s - Status --> Kernel log 266ms 256ms 251ms - Network --> Firewall 936ms 1.08s 1.07s - Network --> Wireless 1.39s 1.42s 1.40s Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
This commit is contained in:
@@ -1,28 +1,26 @@
|
||||
[uwsgi]
|
||||
stric = True
|
||||
uwsgi_modifier1 = 9
|
||||
socket = /var/run/uwsgi.sock
|
||||
cgi-mode = true
|
||||
cgi = /www/cgi-bin/luci
|
||||
chdir = /usr/lib/lua/luci/
|
||||
master = True
|
||||
buffer-size = 10000
|
||||
reload-mercy=8
|
||||
max-requests=2000
|
||||
limit-as=200
|
||||
reload-on-as=256
|
||||
reload-on-rss=192
|
||||
no-orphans=True
|
||||
vacuum=True
|
||||
enable-threads=True
|
||||
post-buffering=8192
|
||||
socket-timeout=120
|
||||
thunder-lock = True
|
||||
logger = syslog:uwsgi
|
||||
daemonize = True
|
||||
disable-logging = True
|
||||
log-format = %(addr) %(method) %(uri) => generated %(rsize) bytes in %(msecs) msecs
|
||||
pidfile=/var/run/uwsgi.pid
|
||||
die-on-term=True
|
||||
fork-socket=True
|
||||
pcre-jit=True
|
||||
strict = true
|
||||
socket = /var/run/uwsgi.sock
|
||||
cgi-mode = true
|
||||
cgi = /www/cgi-bin/luci
|
||||
chdir = /usr/lib/lua/luci/
|
||||
master = true
|
||||
buffer-size = 10000
|
||||
reload-mercy = 8
|
||||
max-requests = 2000
|
||||
limit-as = 200
|
||||
reload-on-as = 256
|
||||
reload-on-rss = 192
|
||||
no-orphans = true
|
||||
vacuum = true
|
||||
enable-threads = true
|
||||
post-buffering = 8192
|
||||
socket-timeout = 120
|
||||
thunder-lock = true
|
||||
logger = syslog:uwsgi
|
||||
disable-logging = true
|
||||
log-format = %(addr) %(method) %(uri) => generated %(rsize) bytes in %(msecs) msecs
|
||||
pidfile = /var/run/uwsgi.pid
|
||||
die-on-term = true
|
||||
threads = 3
|
||||
processes = 3
|
||||
|
||||
@@ -1,34 +1,13 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=79
|
||||
USE_PROCD=1
|
||||
|
||||
start() {
|
||||
core_number=$(grep -c ^processor /proc/cpuinfo)
|
||||
/usr/sbin/uwsgi --ini /etc/uwsgi/uwsgi.conf --threads $core_number --processes $(($core_number * 2))
|
||||
logger -ts "Uwsgi" "Starting Uwsgi process"
|
||||
}
|
||||
|
||||
stop() {
|
||||
pidfile="/var/run/uwsgi.pid"
|
||||
if [ -n "$(pgrep uwsgi)" ]; then
|
||||
if [ -f $pidfile ]; then
|
||||
logger -t "Uwsgi" "Stopping Uwsgi process"
|
||||
kill $( cat $pidfile )
|
||||
else
|
||||
for pid in $(pgrep uwsgi); do
|
||||
if [ -n "$(pgrep uwsgi)" ]; then
|
||||
#Keep trying to kill until the master process is found
|
||||
kill -KILL $pid
|
||||
fi
|
||||
done
|
||||
fi
|
||||
else
|
||||
logger -t "Uwsgi" "Uwsgi not running!"
|
||||
fi
|
||||
}
|
||||
|
||||
reload() {
|
||||
/usr/sbin/uwsgi --reload /var/run/uwsgi.pid
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/uwsgi --ini /etc/uwsgi.conf
|
||||
procd_set_param file /etc/uwsgi.conf
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user