Bài đăng

ActiveMQ 5.x

Hình ảnh
- How does ActiveMQ work ?   ActiveMQ sends message between client application -  producers   Consumers sẽ là recived and process massage. The ActiveMQ broker router each message throught one of two type of destinations:         - a queue : point-to-point         - topic : publish/subscribe - Memory and Storage    A.  Memory      ActiveMQ uses memory to store messages awaiting dispatch to consumers.      ActiveMQ also writes messages to disk , in either a message store (where persistent messages go), or a temp store (where non-persistent messages go when the broker runs out of memory to store them).     Có 2 cách thức gửi message : persistent và non-persistent             non-persistent : Each non-persistent message is stored in memory as it arrives. When the available memory is full, all messages in memory are moved to th...

Linux sysctl Tuning

Hình ảnh
TCP Buffer Sizes # Settings for 1Gb network (16Mb buffer) net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 16384 16777216 # Settings for 10Gb network (32Mb buffer) net.core.rmem_max = 33554432 net.core.wmem_max = 33554432 net.ipv4.tcp_rmem = 4096 87380 33554432 net.ipv4.tcp_wmem = 4096 16384 33554432 # Settings for 10Gb network (54Mb buffer) net.core.rmem_max = 56623104 net.core.wmem_max = 56623104 net.ipv4.tcp_rmem = 4096 87380 56623104 net.ipv4.tcp_wmem = 4096 16384 56623104 Max size (bytes) of the TCP receive buffer as settable with setsockopt. Max size (bytes) of the TCP send buffer as settable with setsockopt. Auto-tuning limits (bytes) for TCP receive buffer: min, default, and max number of bytes. Auto-tuning limits (bytes) for TCP send buffer: min, default, and max number of bytes Queue Sizes While a socket is listen...

Tunning PHP-FPM

Hình ảnh
- Tunning PHP-FPM       + PHP-FPM can listen on multiple sockets. I also listen on Unix sockets, or TCP sockets. - Unix socket : sử trong trong trường hợp các process kết nối với nhau trên cùng một máy, dẫn đến tốc đô  nhanh.    Listening sockets live in the filesystem hierarchy and access to them can be  controlled by filesystem permissions.             - TCP socket Các process có thể kết nối thông qua network. sẽ có tốc độ chậm hơn so với unix socket.  A connected TCP socket is identified by the combination of local IP, local port, remote IP                   and remote port. A listening TCP socket is identified by local port and possibly local IP.    + How the process manager will control the number of child processes           Tùy vào cấu hình sẽ ảnh hưởng tới RAM and CPU.       - static :   ...

MongoDB Backup & Restore

MongoDB Backup & Restore # Các phương pháp backup cho mongoDB    -  mongdump:       + Sử dụng trong trương hợp kích thước data không quá lớn       + Thời gian backup và restore lâu       + Dẽ dàng thao tác    -  rsync and copy       + Phù hợp với kích thước nhỏ       + Thời gian backup lâu, nhưng restore nhanh       + Dễ dàng cho việc thao tác    -  Percona hot backup:       ?    -  Point in time use oplog .       + Cho phép recovery tại một thời diểm mong muốn       + Phải enable oplog => replication       + Thời gian backup and restore nhanh # Tim hieu command "mongodump" - # Quy trình thực hiệc backup : point in time use oplog    - B1. Chuẩn bị để việc login dễ dang hơn                 $  auth ="...

MONGODB: UNDERSTANDING OPLOG

The following table clearly explains what each Oplog field denotes. F Alias Details Operations Values ts TimeSpace Holds the “Time of the operation” & “incremental id”. For all bulk (insert/remove/update) operations “Time of the operation” remains same and id changes to an incremental value. Default value of the id is 1 For All Operations (Time of the operation, incremental id) h  hash a unique ID for each operation For All Operations NumberLong(“7202552052460497158”) t NA NA For All Operations NumberLong(1) v version# version For All Operations 2 op Operation Type Write operations (import/Insert/Delete/Update/) Write Operations i/d/u Commands that affect database (Create, Drop: Database/collection) Command Operations C Informational Operation No-Operation N ns NameSpace The database and collection affected by the operation Write Operations (db_name.collection_name) Command Operations (db_name.$cmd)) No-Operation Blank O Operation Info/Data of the Operations I...