threefoldtecharchive / jumpscaleX_archived

Apache License 2.0
1 stars 6 forks source link

Memory usage of nginx, php and SabreDav #744

Closed 0xIslamTaha closed 5 years ago

0xIslamTaha commented 5 years ago

Enviroment description Docker image: ubuntu 18.04 nginx: 1.14.0 php: 7.2.19 php-fpm: php-fpm7.2 sabreDav: ~3.2.0

Running server

<?php

use
    Sabre\DAV;

// The autoloader
require 'vendor/autoload.php';

// Now we're creating a whole bunch of objects
$rootDirectory = new DAV\FS\Directory('public');

// The server object is responsible for making sense out of the WebDAV protocol
$server = new DAV\Server($rootDirectory);

// If your server is not on your webroot, make sure the following line has the
// correct information
$server->setBaseUri('/saberdav/server.php');

// The lock manager is reponsible for making sure users don't overwrite
// each others changes.
$lockBackend = new DAV\Locks\Backend\File('data/locks');
$lockPlugin = new DAV\Locks\Plugin($lockBackend);
$server->addPlugin($lockPlugin);

// This ensures that we get a pretty index in the browser, but it is
// optional.
$server->addPlugin(new DAV\Browser\Plugin());

// All we need to do now, is to fire up the server
$server->exec();

1- Usage with worker_processes auto::

Memory Usage

ngingx
ps -eo size,command --sort -size | grep nginx | awk '{ hr=$1/1024 ; sum +=hr} END {print sum}'
17.8789
php
ps -eo size,command --sort -size | grep php | awk '{ hr=$1/1024 ; sum +=hr} END {print sum}'
16.9883

htop image

2- Usage with nginx worker_processes 1:

Memory Usage

ngingx
ps -eo size,command --sort -size | grep nginx | awk '{ hr=$1/1024 ; sum +=hr} END {print sum}'
3.90625
php
ps -eo size,command --sort -size | grep php | awk '{ hr=$1/1024 ; sum +=hr} END {print sum}'
16.9883

htop image