Recommended LEMP Configuration for Init Manga on Mid-Range Servers (4 vCPU, 8GB RAM)

When Init Manga starts receiving stable traffic, the number of concurrent users steadily increases, and features such as advanced filtering, recommendations, and Redis caching are used more intensively, small servers will gradually reach their limits. This is where a mid-range server (4 vCPU, 8GB RAM) becomes the ideal choice. This article presents a LEMP configuration that has proven to be very stable in real-world usage, focusing on a balanced approach between performance, durability, and scalability.

Recommended LEMP Configuration for Init Manga on Mid-Range Servers (4 vCPU, 8GB RAM)

Optimization goals for mid-range servers

  • Leverage additional CPU resources to increase real concurrency.
  • Allocate clear and dedicated RAM portions to Redis and MySQL to avoid contention.
  • Allow Nginx to handle a higher number of concurrent connections.
  • Strong enough for Init Manga during peak traffic hours.

Nginx configuration for mid-range servers

At this level, Nginx can be tuned significantly higher than on small servers, while still staying within safe limits to avoid unnecessary RAM consumption.

user www-data;
worker_processes auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log crit;

include /etc/nginx/modules-enabled/*.conf;

worker_rlimit_nofile 100000;

events {
    worker_connections 8192;
    use epoll;
    multi_accept on;
}

http {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    types_hash_max_size 4096;
    server_tokens off;

    keepalive_timeout 30;
    keepalive_requests 100000;
    reset_timedout_connection on;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    access_log off;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;

    open_file_cache max=200000 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors on;

    gzip on;
    gzip_static on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 5;
    gzip_min_length 1024;
    gzip_buffers 32 8k;
    gzip_http_version 1.1;
    gzip_types
        text/plain
        text/css
        application/json
        application/javascript
        application/xml
        image/svg+xml
        font/ttf
        font/otf;

    client_body_buffer_size 256k;
    client_header_buffer_size 64k;
    large_client_header_buffers 4 256k;
    client_max_body_size 128m;

    fastcgi_buffering on;
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

Nginx tuning notes

  • worker_connections 8192: Suitable for medium to high traffic levels.
  • open_file_cache 200000: Effective when serving a large number of chapter images.

PHP-FPM configuration for mid-range servers

With 4 vCPU available, PHP-FPM can scale the number of worker processes to handle more concurrent dynamic requests without becoming a bottleneck.

pm = dynamic
pm.max_children = 16
pm.start_servers = 6
pm.min_spare_servers = 4
pm.max_spare_servers = 8
pm.max_requests = 500

This setup works well when Init Manga relies heavily on dynamic queries and complex filtering logic.

Recommended php.ini settings

post_max_size = 128M
upload_max_filesize = 128M
max_file_uploads = 128
memory_limit = 1024M
max_execution_time = 60
max_input_time = 60

memory_limit 1024M helps prevent out-of-memory errors when handling playlists, multi-condition filters, or large queries.

Redis configuration for mid-range servers

At this level, Redis acts as the primary cache layer for Init Manga, significantly reducing the load on MySQL.

maxmemory 2gb
maxmemory-policy allkeys-lru
save ""
tcp-backlog 65536
timeout 300
tcp-keepalive 300
maxclients 50000
loglevel warning

Allocating 2GB of RAM to Redis allows cache data to live longer and reduces cache misses as traffic grows.

MySQL configuration for Init Manga (mid-range servers)

MySQL is allocated more memory at this stage, with a strong focus on the InnoDB buffer pool to efficiently serve WordPress queries.

[mysqld]
bind_address = 127.0.0.1
max_connections = 200
connect_timeout = 10
wait_timeout = 300
interactive_timeout = 300

table_open_cache = 512
table_definition_cache = 512
thread_cache_size = 64

query_cache_type = 0
query_cache_size = 0

tmp_table_size = 64M
max_heap_table_size = 64M

default_storage_engine = InnoDB
innodb_buffer_pool_size = 2G
innodb_buffer_pool_instances = 2
innodb_log_file_size = 256M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_io_capacity = 800
innodb_read_io_threads = 4
innodb_write_io_threads = 4

slow_query_log = 1
long_query_time = 1

skip_log_bin

Recommended VPS providers for running Init Manga

To ensure the configurations above deliver their intended performance, choosing a stable VPS provider from the beginning is essential. Based on real-world Init Manga deployments, the following providers offer both strong performance and long-term reliability.

Vultr is a good choice if you need international VPS infrastructure, stable CPU performance, and flexible scaling from small to large servers. It is particularly suitable for Init Manga sites targeting global traffic or multiple regions.

Veesp is well suited for projects that require stable VPS performance, generous bandwidth, near-offshore locations, and long-term consistency. With Init Manga, Veesp performs well on both mid-range and large servers, especially when combined with Redis and static file caching.

Both providers are suitable for directly applying the LEMP configurations outlined above, helping Init Manga run stably and scale smoothly as traffic grows.

Conclusion

With a mid-range server (4 vCPU, 8GB RAM), Init Manga can operate very comfortably when LEMP is configured with the right priorities. Nginx efficiently handles a higher number of connections, PHP-FPM provides enough workers for dynamic requests, Redis significantly reduces MySQL load, and the InnoDB buffer pool is allocated an appropriate amount of memory. In the next article, we will move on to large server configurations, where Init Manga begins to handle high traffic and strong concurrency.

Comments


  • No comments yet.

Init Toolbox

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login