Proxy File descriptors status via Web API
File descriptors are a critical component in the operation of the Proxy service, Monitoring the status of file descriptors lets you make sure your proxy service is up and running smoothly.
The number of file descriptors available to the proxy service directly impacts its ability to handle concurrent connections and cache objects.
If the prox service runs out of file descriptors, it can't open new connections or files, which can lead to performance degradation or even service interruption.This feature is available on Artica v4.50 Service Pack 1 or Artica v4.50 Hotfix 20240109-14
What is a File descriptor ?
A file descriptor is a non-negative integer that acts as an abstract indicator for accessing a file or other input/output resource, such as a pipe or network socket.
It's a low-level, yet fundamental concept in Unix/Linux.
When a process opens a file, socket, or another data stream, the kernel returns a file descriptor as a handle to that resource.
This descriptor is then used in subsequent system calls to read from, write to, or manipulate the resource.
Impact on the proxy ?
Basically, all Proxy service components are affected by file descriptors.
You'll therefore find:
- Network Connections Handling: Proxy service handles numerous network connections.
Each active network connection requires a file descriptor.
Therefore, a sufficient number of file descriptors is necessary to maintain these connections efficiently. - Cache Management: Proxy service uses file descriptors to access cached objects stored on disk.
Efficient cache management requires an adequate number of file descriptors to ensure quick retrieval and storage of these objects. - Logging and Monitoring: Proxy service also uses file descriptors for logging purposes.
Each log file that is written to requires a file descriptor.
Monitoring ?
Running out of file descriptors can lead to resource exhaustion, causing Proxy service to become unstable or crash.
Monitoring and appropriately configuring the file descriptor limits is crucial for the stability.
- To monitor this part, ensure you have correctly set the Web API service to listens external network.
- With an HTTP client query the Web API service using GET to
http://1.2.3.4:9503/proxy/monitor/filedesc
You will receive a json
{
"max_filedescriptors": 458522,
"current_file_descriptors": 458522,
"workers": 1,
"must_file_descriptors": 458522,
"config_ok": true,
"error": "",
"status": true
}
- max_filedescriptors: The maximal File Descriptors defined in the Proxy service configuration.
- current_file_descriptors: The number of Max File descriptors parameter the proxy service using in memory
Means max_filedescriptors and current_file_descriptors should be the same or current_file_descriptors must be higuer ( according to the number of workers) - Workers: The number of daemons used for the proxy service
- must_file_descriptors: This is a calculation of the max_filedescriptors/workers. This value must be at least identical to the value max_filedescriptors
- config_ok: True/False, if the file descriptors settings are correct.
- error: Any error if something wrong
- status: must always true, false for an error on the Web API service