diff options
author | Max Romanov <max.romanov@nginx.com> | 2018-01-29 16:17:36 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2018-01-29 16:17:36 +0300 |
commit | 9cd4fdbdb78e035254e8094b5cff2155857ab764 (patch) | |
tree | 6de4ee721996740cbeda8647e11b8b2aa18e704f /test/test_php_basic.py | |
parent | a36babddef203d79dc37736661e1a042df4064f8 (diff) | |
download | unit-9cd4fdbdb78e035254e8094b5cff2155857ab764.tar.gz unit-9cd4fdbdb78e035254e8094b5cff2155857ab764.tar.bz2 |
Introducing extended app process management.
- Pre-fork 'processes.spare' application processes;
- fork more processes to keep 'processes.spare' idle processes;
- fork on-demand up to 'processes.max' count;
- scale down idle application processes above 'processes.spare' after
'processes.idle_timeout';
- number of concurrently started application processes also limited by
'processes.spare' (or 1, if spare is 0).
Diffstat (limited to '')
-rw-r--r-- | test/test_php_basic.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/test_php_basic.py b/test/test_php_basic.py index dd757925..1487a9c5 100644 --- a/test/test_php_basic.py +++ b/test/test_php_basic.py @@ -9,7 +9,7 @@ class TestUnitBasic(unit.TestUnitControl): conf_app = { "app": { "type": "php", - "workers": 1, + "processes": { "spare": 0 }, "root": "/app", "index": "index.php" } @@ -34,7 +34,7 @@ class TestUnitBasic(unit.TestUnitControl): { "app": { "type": "php", - "workers": 1, + "processes": { "spare": 0 }, "root": "/app", "index": "index.php" } @@ -48,7 +48,7 @@ class TestUnitBasic(unit.TestUnitControl): { "app": { "type": "php", - "workers": 1, + "processes": { "spare": 0 }, "root": "/app", "index": "index.php" } @@ -61,7 +61,7 @@ class TestUnitBasic(unit.TestUnitControl): self.assertEqual(self.conf_get('/applications/app'), { "type": "php", - "workers": 1, + "processes": { "spare": 0 }, "root": "/app", "index": "index.php" }, @@ -72,8 +72,8 @@ class TestUnitBasic(unit.TestUnitControl): self.assertEqual(self.conf_get('/applications/app/type'), 'php', 'type') - self.assertEqual(self.conf_get('/applications/app/workers'), 1, - 'workers') + self.assertEqual(self.conf_get('/applications/app/processes/spare'), 0, + 'spare processes') def test_php_get_listeners(self): self.conf(self.conf_basic) @@ -118,9 +118,9 @@ class TestUnitBasic(unit.TestUnitControl): def test_php_change_application(self): self.conf(self.conf_basic) - self.conf('30', '/applications/app/workers') - self.assertEqual(self.conf_get('/applications/app/workers'), 30, - 'change application workers') + self.conf('30', '/applications/app/processes/max') + self.assertEqual(self.conf_get('/applications/app/processes/max'), 30, + 'change application max') self.conf('"/www"', '/applications/app/root') self.assertEqual(self.conf_get('/applications/app/root'), '/www', |