Category: Cluster

Linux Command-Line Fetion for Nagios

To stay on top of production server status in real time, ops engineers must master a fundamental skill: server monitoring. Nagios, a widely adopted server monitoring tool, uses email as its default notification method. The downside is that if an admin hasn’t logged into their email, they may miss critical server status updates. This is where SMS-based notification via Fetion comes in …

How to Handle Session Sharing in Nginx Load Balancer

1) Use cookies instead of sessions

Switching from sessions to cookies can help you avoid some of the drawbacks of sessions. A J2EE book I read long ago also pointed out that you should not use sessions in a clustered system, or it could cause serious trouble. If your system is not complex, consider whether you can eliminate sessions first…

How to Fix php-fpm 100% CPU Usage

How to Fix High CPU Usage on LNMP Server: Troubleshooting Guide
I thought my recently configured LNMP stack was running quite stably, and I was secretly pleased with myself. However, starting last night, I noticed the server’s CPU usage was excessively high, even spiking to 100%. My memory is 1GB, and under normal circumstances, the usage rate should be below 5%, and at most not exceed 10%. Recent monitoring from Alibaba Cloud shows: cmhello.com-201303089 using to …

High Availability with MySQL, DRBD, and Heartbeat

1. What Is DRBD
DRBD (Distributed Replicated Block Device), touted as "Network RAID", is an open-source software developed by LINBIT.
2. Main Functions of DRBD
DRBD is essentially a block device implementation, primarily used in high availability (HA) solutions on Linux platforms. …

Three Common Ways Data Gurus Use Hadoop

As Hadoop technology evolves, from initially solving massive data storage problems for companies like Google and Facebook, to now being adopted by more and more enterprises for processing big data, Hadoop has had a profound impact on the enterprise data landscape. Understanding its common usage patterns can greatly reduce complexity. Just a few weeks ago, A …

Image Server Overhaul Plan for a Large-Scale Website

1. The current website image server structure is as follows:

2. Existing Structure Description
2.1 Mount Directory Description
All front-end web servers mount the directories exported by the three image servers via NFS to receive images written by the PHP processes on the web servers. Then, image1 mounts the e …

PHP Session Cross-Subdomain Issues Summary

Today, I ran into an issue while working on a project. Previously, when dealing with sessions, I would typically store them directly in the database, which solves cross-domain problems — not just cross-subdomain ones. But today’s issue was different: I had to make modifications on top of someone else’s existing work. Since it only involved subdomains, I was confident there had to be a simple solution. After Googling (Baidu-ing) for about 10 minutes, I got it sorted.

The Rose Portal in the Holy War

June 9, 2010, was a day of online crusade. It began right at midnight, and the main event unfolded as expected at 7 p.m. The battleground on Renren was SJ’s public page: http://page.renren.com/sj For different people, this day meant different things, with different emotions. As the Renren tech team, we had to ensure service …

Hands-on Nginx and PHP (FastCGI) Installation, Configuration and Optimization

I. What is FastCGI
FastCGI is a scalable, high-speed interface for communication between HTTP servers and dynamic scripting languages. Most popular HTTP servers support FastCGI, including Apache, Nginx, and lighttpd. At the same time, FastCGI is also supported by many scripting languages, including PHP.
FastCGI evolved and improved from CGI. The main drawback of the traditional CGI interface is poor performance, because every time the HTTP server encounters a dynamic program it needs to restart the script parser to perform parsing, and then the result is returned to the HTTP server. When handling high-concurrency access, this is almost unusable. Additionally, the traditional CGI interface method has poor security and is now rarely used.
The FastCGI interface method uses a C/S architecture, allowing the HTTP server and the script parsing server to be separated, while starting one or more script parsing daemon processes on the script parsing server. Whenever the HTTP server encounters a dynamic program, it can directly deliver it to the FastCGI process for execution, and then return the obtained result to the browser. This method allows the HTTP server to focus on handling static requests or returning the results of the dynamic script server to the client, which greatly improves the performance of the entire application system.