I have a server(VPS) with 4gb ram. I would like to create 4 cpanels with allowed RAM as 1gb each, so that they use their individual memory. How can i do so using ssh?
if you want to setup memory limit for your user then you need to use CloudLinux OS on your server, With the CloudLinux server you can set memory, process and cpu limit on account basis
https://www.cloudlinux.com/about/features.php
Related
Running mariadb in micro instance with 600MB memory, and its a very low usage instance and for testing purpose.
Is there a way to reduce the memory consumption for this test database instance?
Tried turning off performance schema and other options available in this link, but still, the memory consumption is about 600 MB.
Reducing memory consumption of mysql on ubuntu#aws micro instance
My question is about mysql databases on same hardware / mysql instance and how it affects memory usage: INNODB_BUFFER_POOL more specific.
Today, we have all our DBs: Dev, BackUp and Live; residing on same rack/mysql server instance.
Would it be useful to build new server? Like Separate hardware and mysql instance to allocate better memory for each needs (DEV,BackUp,Live)? Is there a way to allocate memory for each DB individually if they reside on same hardware / mysql instance?
Ex: DB1 can use max 64GB RAM, DB2 only max 16GB
I was thinking about building a standard server, for backup and Development, Testing. For the Live(production) server leave a better build ( memory, hardware) and leave it as dedicated as possible with only DB and tables needed.
Here some article I was reading as reference regarding what Im trying to explain.
https://haydenjames.io/mysql-performance-drop-unused-databases/
Thanks
Is there any difference (or preference) between two schemes:
Apache & MySQL are installed on the same VPS (4Gb RAM, 2 CPU Cores) and each of them configured for 2GB RAM,
Apache and MySQL installed on separate VPS (2Gb RAM, 1 CPU Core).
Thank you.
It is better to go for separate vps server
Following are the reason
1) can boost performance, u can balance the load equally
2) easier to set up replication if you have separate standalone DB server
3) easier to trouble shoot if there is a problem either in apache or mysql
4) normally if you have separate DB instance, you will allocate 80% of your RAM memory to Myisam or Innodb engine for better concurrency. If both kept in same vps, u will have to sacrifice concurrency, scalability
I have an AWS t2.micro EC2 instance with docker on it, and I bring up the following instances;
jwilder/nginx-proxy
mysql
wordpress
Which results in something like this docker stats;
CONTAINER MEM USAGE/LIMIT MEM %
wordpress 331.9 MB/1.045 GB 31.77%
nginx 18.32 MB/1.045 GB 1.75%
mysql 172.1 MB/1.045 GB 16.48%
Then, I run siege's default 15 concurrent connections against it, which spawns multiple apache processes, reaching the memory limit of the EC2 instance, crashing docker and bash due to no more memory, requiring my intervention to get it all running again.
I have a couple of questions regarding this.
Am I expecting too much? Should this setup be able to handle 15 concurrent connections? If so, what changes* need to be made?
How can I automate recovery from this? Is there a way to detect that memory is reaching capacity and do something (like reject requests or similar) until memory usage decreases? Is there a way to keep the system stable during the high request volume so once it's over it does not require my intervention to bring it back up?
* I've already done this to drop mysql memory from 22% to 15%.
Given a t2.micro only has 1GB total, and each of those containers has a 1GB limit on its own, have you tried limiting the max memory usage on each container (as per http://docs.docker.com/engine/reference/run/#user-memory-constraints) such that the total memory limit doesn't exceed 1GB?
The biggest impact, which stopped the EC2 instance from falling over, was limiting the memory a docker container can use with the -m option per #palfrey's answer.
Some additionally tweaks were required to reduce the memory footprint and have the service respond to 15 concurrent users, albeit somewhat slowly. This included;
MySQL
Disabling performance_schema
Using a minimal config
WordPress
Disabling KeepAlive
Limiting servers:
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 1
MaxSpareServers 3
MaxRequestWorkers 10
MaxConnectionsPerChild 3000
</IfModule>
Docker
I created some docker images that extend the default images to include these optimisations;
mysql-minimal
wordpress-minimal
Further details in my blog post.
Probably, a micro only has 1GB of ram. You can run this configuration without docker just fine, but you do have to adjust for memory limitations. Docker probably adds some overhead. Is there a reason for running both nginx and apache?
Generally you test and limit your threads to what the system can handle, there are probably things you can do with caching that will help improve performance. Apache, nginx, php-fpm all have settings that can control the number of threads that are allowed to be created.
I am a MYSQL beginner and I want to allocate more memory to MYSQL.
My machine is Windows 7 64 bit OS with 12GB RAM and Mysql version is 5.6.
Any one can give me the commands to increase memory for MYSQL.
there is a file called my.ini for mysql(windows) which contains
'innodb_buffer_pool_size=M'
(if no such field you can add explicitly under mysqld tag) where M is MB you can use G for GB increasing this value will solve your purpose and remember to verify using query
show variables like '%innodb_buffer_pool_size%';