Friday 9 December 2022

Max parallel HTTP connections in a browser to a single website/domain

Untuk Firefox

1. Di address bar firefox ketik about:config

2. Lihat config : network.http.max-connections-per-server dan network.http.max-persistent-connections-per-server  lihat nilainya, bisa dinaikkan sesuai kebutuhan

how to configure maximum number of connections that it will accept from a single client in nginx

Berikut jawaban ChatGPT, jawaban ini perlu divalidasi : 

To configure the maximum number of connections that nginx will accept from a single client, you can use the max_conns directive in the http or server block of your nginx configuration file. For example, to limit the number of connections to 100 for a specific server, you could use the following configuration:

http {


    server {


        max_conns 100;




Keep in mind that this directive only applies to connections from individual clients, and not to the total number of connections that nginx will accept. To limit the total number of connections that nginx will accept, you can use the worker_connections directive in the events block of your configuration file. For example:

http {
    events {
        worker_connections 1024;

This will allow nginx to accept a maximum of 1024 connections in total. You can adjust this value as needed to suit your specific requirements.

Please note that this is just an example configuration, and you should adjust the values to suit your specific needs and environment. It is also recommended to consult the nginx documentation for more information on configuring nginx and its various options.


  1. Max parallel HTTP connections in a browser?,

Saturday 3 December 2022

Mengganti seluruh teks yang ada di luar tag.

 Misalkan kita memiliki teks seperti berikut : 

Nusantara_berdikari : [latex]\begin{aligned} \mathrm{Population_t} &= \alpha_1 + \gamma_1 X_{1,t} + \gamma_2 X_{1,t-1} \\ \mathrm{Price_t} &= \alpha_2 + \beta_1 Z_{1,t} \end{aligned}[/latex] Nusantara_sejahtera

Bagaimana mengganti semua "_" menjadi "\_" kecuali yg berada di dalam tag [latex][/latex] ? 

Salah satu solusi dari [1] :

* @param string $text
* @param array $str_to_replace
* @param string $str_replace_with
public static function replaceTextOutsideTags($text = null, $str_to_replace = [], $str_replace_with = ''){
$p = implode('|', array_map('preg_quote', $str_to_replace));
$result = preg_replace("#\[latex\].*?\[\/latex\](*SKIP)(*FAIL)|($p)#i", $str_replace_with, $text);

return $result ;


  1. preg_replace keywords OUTSIDE of <strong> tags,

Friday 13 August 2021

Dashboard Monitoring Apache Server, php-fpm & MySQL



Listen 8181

<VirtualHost *:8181>


    ErrorLog /var/log/apache2/status_error.log

    CustomLog /var/log/apache2/status_access.log common

    <Location /server-status>

        SetHandler server-status

        Require all granted



apache Exporter untuk Prometheus (Lusitaniae)









ExecReload=/bin/kill -HUP $MAINPID

ExecStart=/usr/local/bin/apache_exporter \

  --insecure \

  --scrape_uri=http://localhost:8181/server-status/?auto \

  --telemetry.address= \





1. php-fpm Exporter untuk Prometheus (Lusitaniae)


pm.status_path = /status-phpfpm72

sudo apt install golang-go

git clone

cd phpfpm_exporter

make build



Description = PHP-FPM Prometheus Exporter



ExecReload=/bin/kill -HUP $MAINPID

SyslogIdentifier = phpfpm_exporter

ExecStart = /opt/phpfpm_exporter/phpfpm_exporter \

   --phpfpm.socket-paths /var/run/php/php7.2-fpm.sock \


   --phpfpm.script-collector-paths /usr/local/bin/php_exporter/phpfpm_opcache_exporter.php


WantedBy =

systemctl daemon-reload

systemctl enable --now php-fpm_exporter

systemctl status php-fpm_exporter


2. php-fpm Exporter untuk Prometheus (hipages)

Dapat juga menggunakan exporter berikut :


nano /etc/systemd/system/php-fpm_exporter.service

Description = PHP-FPM Prometheus Exporter

ExecReload=/bin/kill -HUP $MAINPID
SyslogIdentifier = phpfpm_exporter

ExecStart = /usr/local/bin/phpfpm_exporter/php-fpm_exporter_2.2.0_linux_amd64 server --web.listen-address --phpfpm.scrape-uri tcp://  --phpfpm.fix-process-count true

WantedBy =


[9][10]. Untuk Grafana dashboard, dapat menggunakan id 6239


Install dan mengamankan prometheus yang secara default dapat diakses tanpa password di port 9090, baca [6].


# my global config


  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.

  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.

  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration



    - static_configs:

        - targets:

          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.


  # - "first_rules.yml"

  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:

# Here it's Prometheus itself.


  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.

  - job_name: "prometheus"

    # metrics_path defaults to '/metrics'

    # scheme defaults to 'http'.


      - targets: ["localhost:9090"]

  # Apache Servers

  - job_name: "apache"


      - targets: ["localhost:9117"]

  # php-fpm

  - job_name: "php-fpm7.2"


      - targets: ["localhost:9253"]


  1. Apache Exporter for Prometheus,
  2. Install Prometheus on Debian 10,
  3. Monitor Apache Web Server with Prometheus and Grafana in 5 minutes,
  4. Grafana support for prometheus,
  5. PHP-FPM Exporter for Prometheus,
  6. Securing Prometheus API and UI endpoints using basic auth,
  7. Real-time PHP-FPM Status,
  8. Prometheus Server and TLS,
  9. How to Monitor MySQL Deployments with Prometheus & Grafana at ScaleGrid,
  10. MySQL Server Exporter,

Composer : A Dependency Manager for PHP



  1. Composer : A Dependency Manager for PHP,
  2. Introducing graph visualization of composer package dependencies,

Sunday 28 March 2021


Agar classes graph dapat digenerate tambahkan opsi : --setting=graphs.enabled=true lalu jangan lupa install graphviz dan plantuml.