Memory usage of nginx passenger in a VPS server with Ubuntu 16.04 and 512 MB Ram

Memory usage with nginx passenger, and single rails application running:

Here is 3 memory info with free -m command 3 different times:

               total        used        free      shared  buff/cache   available
Mem:            488         171          75           2         241         274
Swap:          2047         558        1489
               total        used        free      shared  buff/cache   available
Mem:            488         185          41          28         260         247
Swap:          2047           0        2047
               total        used        free      shared  buff/cache   available
Mem:            488         330           7          27         149         101
Swap:          2047           4        2043

Memory usage with nginx passenger, 1 rails application running, and php 7.1 installed:

              total        used        free      shared  buff/cache   available
Mem:            488         181          37          26         268         251
Swap:          2047         141        1906

nginx passenger, 1 rails application running, and running 1 yii2 application with php 7.1

              total        used        free      shared  buff/cache   available
Mem:            488         217          10          24         260         217
Swap:          2047         138        1909

Topic: