Skip to content

Instantly share code, notes, and snippets.

@prabowo87
prabowo87 / php-pools.md
Created November 24, 2023 14:51 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@prabowo87
prabowo87 / 0- install nodejs and redis.sh
Created August 26, 2021 03:33 — forked from moaalaa/0- install nodejs and redis.sh
How to run PM2 with laravel queue and laravel echo server
# Node Js
curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
sudo yum install nodejs
node --version
npm --version
# Redis
@prabowo87
prabowo87 / ApiManager.java
Created March 20, 2017 03:08 — forked from andraskindler/ApiManager.java
SwipeRefreshLayout example
package com.andraskindler.sandbox.activity;
import retrofit.RestAdapter;
import retrofit.http.GET;
import retrofit.http.Query;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
public class ApiManager {
@prabowo87
prabowo87 / TextHighlight.java
Created November 27, 2016 11:52 — forked from pratamawijaya/TextHighlight.java
TextHighlight.java
// digunakan untuk Highlight text yang sedang dicari
private void setColor(TextView view, String fulltext, String subtext, int color) {
view.setText(fulltext, TextView.BufferType.SPANNABLE);
Spannable str = (Spannable) view.getText();
int i = fulltext.indexOf(subtext);
str.setSpan(new ForegroundColorSpan(color), i, i + subtext.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}