502 Server Error | App engine NodeJS, SocketIO

295 views
Skip to first unread message

Mr Fambo

unread,
Apr 30, 2020, 4:54:36 AM4/30/20
to Google App Engine
I am continuously having my App Engine instance restarted again and again. It gives me 502 Server error. Logs not showing anything except for

[error] 33#33: *7177 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 35.191.1.226, server: , request: "GET /readiness_check HTTP/1.1", upstream: "http://172.17.0.1:8080/readiness_check", host: "10.128.0.45"

I do have my /readiness_check up and running on Express. I am using websockets (socket.io) on my instance. So far i see no any logs related to app failures.

If i go to monitoring i see Nginx -> Agent CPU Utilisation 100% when the app went down.

How can i fix this?

```
# [START appengine_websockets_yaml]
runtime: nodejs
env: flex

inbound_services:
- warmup

automatic_scaling:
max_idle_instances: 1
min_num_instances: 2
max_num_instances: 5
cool_down_period_sec: 180
cpu_utilization:
target_utilization: 0.6
target_concurrent_requests: 100

network:
session_affinity: true

liveness_check:
path: "/liveness_check"
check_interval_sec: 30
timeout_sec: 5
failure_threshold: 2
success_threshold: 2

readiness_check:
path: "/readiness_check"
check_interval_sec: 5
timeout_sec: 4
failure_threshold: 2
success_threshold: 2
app_start_timeout_sec: 600
# [END appengine_websockets_yaml]

Screenshot 2020-04-30 at 1.19.38 AM.png


Screenshot 2020-04-22 at 11.11.16 PM.png

Screenshot 2020-04-30 at 1.37.18 AM.png

Screenshot 2020-04-30 at 1.37.46 AM.png

Screenshot 2020-04-30 at 1.39.25 AM.png




Katayoon (Cloud Platform Support)

unread,
Apr 30, 2020, 3:22:35 PM4/30/20
to Google App Engine
Hello,

I see you are using the default resource settings in your yaml file that doesn't seem to be sufficient. Could you increase the CPU (I recommend at least 4 cores) and memory to see if this resolves the issue? If the issue still persists, you may report it to the public issue tracker so that we would be able to look into it efficiently. 


Mr Fambo

unread,
Apr 30, 2020, 3:38:16 PM4/30/20
to Google App Engine

Screenshot 2020-05-01 at 12.37.22 AM.png


I have updated the resources to your suggested values. Let's see if it resolves the issue. If it doesn't i will report to public issue tracker.
Reply all
Reply to author
Forward
0 new messages