# Handshake timed out after 10000ms with huge load

**URL:** <https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531>\
**Category:** Gatling (Open-Source)\
**Created:** [December 8, 2023, 3:47am UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531 "2023-12-08T03:47:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [December 8, 2023, 3:47am UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531/1 "2023-12-08T03:47:19Z")

</div>

Hi, I have an issue when reaching a certain Users such as this:  
`i.n.h.s.SslHandshakeTimeoutException: handshake timed out after 10000ms`  
This is my inject pro5

```auto
.inject(
                  rampConcurrentUsers(1).to(5000).during(2500),
                  constantConcurrentUsers(5000).during(SteadyLength),
                  rampConcurrentUsers(5000).to(1).during(500)
)

```

Usually the error appear at 900 seconds timestamp - 1800 Users reached, then REST API following fails to be executed, mostly with 500, 503, 504 errors.  
.  
The odd thing is that when I change the target pool to 2000 with 1000 seconds ramp time, everything went smoothly without any issues, I checked the log and see that with same timestamp at 400 seconds, the total connections made in both pro5 was in a huge difference (around 1500 Users vs 6000 Users) what could have happened in this pro5 to cause this difference?

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [December 8, 2023, 7:56am UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531/2 "2023-12-08T07:56:11Z")

</div>

TLS handshakes are nowadays very expensive CPU-wise, because of the long keys and complex ciphers.  
Your server is most likely saturated, Gatling is just the messenger here.

---

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [December 8, 2023, 8:01am UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531/3 "2023-12-08T08:01:34Z")

</div>

Hi @slandelle , thanks for your perspective view on this matter,  
Can you also explain in the last paragraph I wrote there ? I just want to understand more how Gatling create Virtual Users in a thread, hopefully it won’t be a hard topic to understand

**when I change the target pool to 2000 with 1000 seconds ramp time, everything went smoothly without any issues, I checked the log and see that with same timestamp at 400 seconds, the total connections made in both pro5 was in a huge difference (around 1500 Users vs 6000 Users) what could have happened in this pro5 to cause this difference?**

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [December 8, 2023, 8:17am UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531/4 "2023-12-08T08:17:08Z")

</div>

If you reduce the number of users per second, you’re obviously going to reduce the number of TLS handshakes per second.  
Moreover, when you start experiencing failures, depending on how your scenario is design, your users who failed to perform (TCP connect + TLS handshake) are going to try again on the next request.

---

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [December 9, 2023, 3:17am UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531/5 "2023-12-09T03:17:22Z")

</div>

Hi @slandelle , I think this is a weird behavior, as I tested around with this scenario

```auto
2000 Users, ramping rate 2 Users / sec (ramping time 1000 seconds), duration 1 hour
5000 Users, ramping rate 2 Users / sec (ramping time 2500 seconds), duration 1 hour

```

for 2000 Users case, everything is still fine and 5000 Users things started to crash at 15 minutes.  
With log enabled, the huge difference are still there (1500 Users opened vs 6000 Users opened at time stamp )  
Is the total Users of Gatling calculated beforehand and all pushed into server at the mean time ?  
Please explain me more on this.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [December 9, 2023, 6:58pm UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531/6 "2023-12-09T18:58:03Z")

</div>

Sorry, but we can’t help without a reproducer. Moreover, if this is about the third party gRPC plugin, that’s not something we support here.

---

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [December 11, 2023, 8:18am UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531/7 "2023-12-11T08:18:05Z")

</div>

Hi @slandelle , I only cover REST HTTP in this topic, gRPC was in the past 😊 After rough discussions we have figured out where the problem is, I have learnt a lot from this, thank you.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [January 10, 2024, 8:18am UTC](https://community.gatling.io/t/handshake-timed-out-after-10000ms-with-huge-load/8531/8 "2024-01-10T08:18:47Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
