Monthly Archives: January 2018

php-fpm child processes memory usage

Often you need to adjust php-fpm for the memory available, and to do so you need to average the child processes memory usage.

Human readable:

 ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep php-fpm 

and also machine friendly:

 ps -ylC php-fpm --sort:rss 

Fix i3wm tearing in ubuntu

i3 is great window manger, but for some time I had struggles fixing some tearing it had, until I found recently this answer, which fixed it for me.

You will have to install the comptom composite manager with:

sudo apt install compton

then use the following config in ~./config/compton.conf or wherever you prefer to keep you config files. Then place this in that config file:

# basic configuration
backend = "glx";
vsync = "opengl-swc";

glx-copy-from-front = true;
glx-swap-method = 2;
xrender-sync = true;
xrender-sync-fence = true;

# transparancy settings for i3
opacity-rule = [
    "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];

Or this variation:

backend = "glx";
glx-no-stencil = true;
paint-on-overlay = true;
vsync = "opengl-swc";

Now you can start compton with that config file to test if it solves the problem for you:

compton --config ~/.config/compton.conf -b 

If that work for you, you can place it in your i3wm config file, so it will be loaded on startup –

  exec --no-startup-id compton --config ~/.config/compton.conf -b