Score:0

Elastic Beanstalk worker tier Degraded, SQS daemon keep repeating "init: initializing aws-sqsd 3.0.3"

in flag

The env will be Degraded and no message can't be sent.

Platform is Docker using dockerrun.aws.json. Container is a Django app. I tried with two instance types (I confirmed it from EC2 dashboard) t2.micro t2.small

Sometimes, after deployment, the SQS daemon keep repeating the init like this, CPU usage will be max

2022-03-23T07:47:51Z init: initializing aws-sqsd 3.0.3 (2020-11-04)
2022-03-23T07:47:56Z init: initializing aws-sqsd 3.0.3 (2020-11-04)
2022-03-23T07:48:01Z init: initializing aws-sqsd 3.0.3 (2020-11-04)
2022-03-23T07:48:07Z init: initializing aws-sqsd 3.0.3 (2020-11-04)
2022-03-23T07:48:12Z init: initializing aws-sqsd 3.0.3 (2020-11-04)
2022-03-23T07:48:18Z init: initializing aws-sqsd 3.0.3 (2020-11-04)
2022-03-23T07:48:23Z init: initializing aws-sqsd 3.0.3 (2020-11-04)
2022-03-23T07:48:28Z init: initializing aws-sqsd 3.0.3 (2020-11-04)
2022-03-23T07:48:33Z init: initializing aws-sqsd 3.0.3 (2020-11-04)

To fix it I need to redeploy the app but it's not always gonna fix it. I thought it's memory issue, but it did work in t2.micro for one time. I wanted to do a memory profiling but looks like too much of a work.

I've tried:

  • using previous platform version
  • rebuilding the env from scratch
Score:0
mx flag

It's because SQS Daemon can not find pid file. I had same problem and fixed it.

  1. Edit /etc/systemd/system/sqsd.service file like below.
[Unit]
Description=This is sqsd daemon
PartOf=aws-eb.target

[Service]
User=sqsd
Type=forking

ExecStartPre=/bin/sh -c "mkdir -p /var/run/aws-sqsd"
ExecStart=/bin/sh -c "/opt/elasticbeanstalk/lib/ruby/bin/aws-sqsd start"
ExecStartPost=/bin/sh -c "systemctl show -p MainPID sqsd.service | cut -d= -f2 > /var/run/aws-sqsd/default.pid"
ExecStartPost=/bin/sh -c "ln -s /var/run/aws-sqsd/default.pid /var/pids/sqsd.pid"

ExecStopPost=/bin/sh -c "rm -f /var/run/aws-sqsd/default.pid"
ExecStopPost=/bin/sh -c "rm -f /var/pids/sqsd.pid"
Restart=always

EnvironmentFile=/opt/elasticbeanstalk/config/private/ruby_common_env

StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sqsd

[Install]
WantedBy=multi-user.target
  1. Reload SQS Daemon : systemctl daemon-reload
  2. Restart SQS Daemon : systemctl restart sqsd
Abirafdi Raditya Putra avatar
in flag
Thank you, but turns out my problem was really memory issue. SQS daemon took so much memory. Instance with 1GB RAM is not enough (running Django).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.