Browse Source

gluon-status-page-api: limit uhttp max_requests to 16 on devices with <48MB RAM (#1045)

Christof Schulze 7 years ago
parent
commit
946d873c14

+ 7 - 2
package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api

@@ -8,6 +8,11 @@ uci -q batch <<-EOF
 	delete uhttpd.main.listen_https
 
 	set uhttpd.main.home=/lib/gluon/status-page/www
-
-	set uhttpd.main.max_requests=32
 EOF
+
+RAM=$(awk '/MemTotal/ {print $2}' /proc/meminfo)
+if [ $RAM -lt $((48*1024)) ]; then
+	uci set uhttpd.main.max_requests=16
+else
+	uci set uhttpd.main.max_requests=32
+fi