The trick is to only register the listener for events that indicate failure, namely
- PROCESS_STATE_STOPPED
- PROCESS_STATE_EXITED
- PROCESS_STATE_FATAL
Once they do, we should send a SIGQUIT to Supervisor.
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "testing" | |
| "time" | |
| "github.com/go-redis/redis/v8" |
| resource "digitalocean_droplet" "web" { | |
| image = "ubuntu-16-04-x64" | |
| name = "web-1" | |
| region = "sgp1" | |
| size = "512mb" | |
| ssh_keys = [12345] | |
| connection { | |
| type = "ssh" | |
| user = "root" |
| # webapp-ingress | |
| apiVersion: networking.k8s.io/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: webapp | |
| annotations: | |
| kubernetes.io/ingress.class: nginx | |
| # # type of authentication | |
| # nginx.ingress.kubernetes.io/auth-type: basic | |
| # # name of the secret that contains the user/password definitions |
| # jenkins-ingress | |
| apiVersion: networking.k8s.io/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: jenkins | |
| annotations: | |
| kubernetes.io/ingress.class: nginx | |
| # type of authentication | |
| nginx.ingress.kubernetes.io/auth-type: basic | |
| # name of the secret that contains the user/password definitions |
| apiVersion: v1 | |
| kind: List | |
| items: | |
| - apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: jenkins | |
| labels: | |
| app: jenkins | |
| spec: |
| apiVersion: v1 | |
| kind: List | |
| items: | |
| - apiVersion: v1 | |
| kind: Service # K8s Service | |
| metadata: | |
| name: simple-web-app-svc | |
| labels: | |
| app: simple-web-app | |
| spec: |
| package main | |
| import ( | |
| "fmt" | |
| "syscall" | |
| ) | |
| type DiskStatus struct { | |
| All uint64 `json:"all"` | |
| Used uint64 `json:"used"` |
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
Pattern file: /etc/logstash/patterns/nginx
Logstash shipper: /etc/logstash/conf.d/shipper.conf
Nginx http log module: http://nginx.org/en/docs/http/ngx_http_log_module.html