Ok, have time now ... this could easily spill over into 'information overload' ... so bear that in mind with items below.
Top:
First ... 2 Gig memory *may not* be enough - other factors determine.
This is just me: have found the 'sweet spot' for servers that are standalone ... web/DB on same server to be 16 Gig. Can work with 8Gig if site not that heavily used. Lower one goes, however, and, depending upon usage, performance suffers.
SWAP ... when server was initial installed, linux generally looks at
total memory and then recommends SWAP space to be equal to memory OR
twice as much. So 2Gig mem = 2Gig SWAP or 4Gig SWAP. Yours did equal. IF this were in a Virtualized environment, like VMWare/other, no biggy to increase memory ... next reboot of server the guest OS recognizes the extra memory. SWAP space and anything related to disk, even if allocated by VMWare/other, operating system doesn't know about and won't use it until configured to do so. Those sorts of operations can get into hardcore command line things ... and one better do them right ... or risk loosing what you have.
SWAP means reads/writes to disk ... DB's run best IF one can get as much of the DB's being served in memory ... that makes sense, doesn't it?
Using NO SWAP space right now ... is good.
But ... see there isn't much left free Mem ... which could mean if the moodle gets busy, SWAP will eventually be used. Try as you might, with 2Gig memory, one might have to live with some SWAP.
This comes into play with the balancing act between apache and mysql.
The Performance Metrics output - what you have available:
[--] Physical Memory : 2.0G
[--] Max MySQL memory : 617.8M
Note the second item above.
[OK] Maximum reached memory usage: 244.2M (12.15% of installed RAM)
[OK] Maximum possible memory usage: 617.8M (30.73% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
% of installed RAM ... have read, Persona, that if one could be DB to use 80% of memory, best. Have never been able to, however, best, 60%.
Since InnoDB is required now ... 3.2+> then anything related to InnoDB config more important now than before:
[!!] InnoDB File per table is not activated
Activate file per table.
[!!] InnoDB buffer pool / data size: 128.0M/1.0G
Buffer pool too low (128M) when compared to the actual data size: 1 Gig.
(remember, however, your mem is 2 Gig!)
You can see in recommendations, MySQL Tuner does make a couple
recommendations to settings that relate to InnoDB
innodb_file_per_table=ON
innodb_buffer_pool_size (>= 1G) if possible.
NOTE the 'if possible'.
Remember, you have 2 Gig to work with in real RAM .... and only 2 Gig of space for SWAP.
Bottom Line: get more true Memory ... Moodle is a 'memory hog' ... does more ... requires more.
Will stop at this point .... am suffering brain cramp just talking about it!
'spirit of sharing', Ken