Why is the request cut off during long operations (report, file upload); which timeout should I increase?
Short answer
If the Backend Service sends no data at all for a long time while preparing the response, Server Timeout runs out and the client receives 504; if the client sends no data for a long time during an upload, Client Timeout runs out. Neither duration is the total operation time; both are the longest silence in the data flow. The solution is to create a Timeouts profile with a Server timeout (and, if necessary, a Client timeout) greater than the longest silent period of the operation and assign it to the related vService (long-lasting operations).
Problem: Long Operations Are Always Cut Off After the Same Duration
If operations such as generating a report, exporting or uploading a large file always fail at the same second, a timeout is running out. Which duration ran out is understood from the symptom and the error code:
| Symptom | Duration that ran out |
|---|---|
| The operation ends with 504 at the same second | Server Timeout |
| The connection drops in the middle of the upload | Client Timeout |
| 503 after waiting during busy hours | Queue Timeout (How does the queue work; how long do requests wait at most?) |
| It cannot connect to the Backend Service at all | Connect Timeout |
Solution: Two Methods
| Your situation | Suitable method |
|---|---|
| From the interface | Method 1: Timeouts profile |
| From the command line | Method 2: WEB-CLI |
Method 1: Timeouts Profile Recommended
- How it works A separate Timeouts profile is created for long operations and assigned only to the related vService; the other vServices are not affected.
- Where it is openedLoad Balancer → Profiles → Timeouts · vService → Details → Timeout
- Requirement The longest silent period of the operation on the Backend Service must be known (measured)
- vService type HTTP · L7 TCP
Step-by-Step Configuration
Load Balancer → Profiles → Timeouts → Add is clicked (how to add). If the profile used by the vService belongs only to this vService, it can also be opened with right-click on its row → Edit; first, the vServices that use the profile are checked in the Used in tab of the preview (Used in).
The profile name is written in the Name field (e.g. rapor-servisi).
Server Timeout is raised above the longest silent period of the operation on the Backend Service (e.g. 300). The values are in seconds (0–60,000); fields left empty use the default.
If the connection drops in the middle of the upload, Client Timeout is also increased (e.g. 120).
Add is clicked for a new profile, and Save when editing.
Load Balancer → Load Balancer vService List → vService → Edit; in the Details panel, the Timeout box is checked and the profile is selected from the list (how to add to a vService).
Save is clicked. Timeouts changes are applied without dropping open connections. In a cluster, it is also sent to the peer device with the default auto-sync; if Manual Sync Mode is on, it is sent with Synchronize.
Verification
The operation is repeated; the 504 records are checked with the Status code filter on the HTTP Logs screen of the vService.
No 504 recordWhile the vService is in Debug mode (HTTP only), the Termination State value of the Debug Mode Logs record is checked.
Server timeout / Client timeout does not appearMethod 2: WEB-CLI
- How it works The profile is created from the command line and bound to the vService.
- Where it is opened TR7 WEB-CLI →
lb timeouts·lb service - Requirement WEB-CLI access
- vService type HTTP · L7 TCP
Step-by-Step Configuration
The values are in seconds (Timeouts examples):
lb timeouts add name rapor-servisi --serverTimeout 300 --clientTimeout 120lb service update id <vService> --timeout rapor-servisiVerification
The operation is repeated; the 504 records are checked with the Status code filter on the HTTP Logs screen of the vService.
No 504 recordCommon Mistakes
- Thinking the duration is the total operation time. Server and Client timeout limit the longest silence in the data flow; as long as data flows, the connection is not cut off.
- Enlarging the default profile for all vServices. A long duration is given only to the vService that needs it, with a separate profile; unnecessarily long durations accumulate hanging connections.
- Increasing the HTTP request timeout. This duration limits the receiving of the request headers; while WAF is on (Wait for Body unchecked) or Debug mode is on, the upload body is also included in this duration (Large file uploads fail; why?), otherwise it is not decisive for a long report or a large upload.
- Enlarging the value blindly. The real duration of the Backend Service is measured and the value is increased gradually.
- The meaning of the fields. The description of all the timeouts: What do the values in the Timeouts profile (HTTP Keepalive Timeout, HTTP Request Timeout, Connect, Server, Client, Queue, Tunnel(Websocket) Timeout, Client FIN, Server FIN) mean?
How it is done in the documentation
Related questions
- What do the values in the Timeouts profile (HTTP Keepalive Timeout, HTTP Request Timeout, Connect, Server, Client, Queue, Tunnel(Websocket) Timeout, Client FIN, Server FIN) mean?
- My WebSocket connections drop after a certain time; what should I do?
- How does the queue work; how long do requests wait at most?
