Overview
In the Rails framework, web utility applications provide compute and services to Engine Yard, as explained in the Utility Instance Cheat Sheet. In this article, we will cover the most common applications and provide some information aimed at helping with debugging them; however, a similar approach can be used for most of the supported applications.
Contents:
The utility applications
Engine Yard supports a variety of utility applications. These are applications that run alongside the application server and the database and provide functionality or compute to the Rails application. They are installed in one of a few ways, as explained in Customizing Chef:
- Through a custom recipe
- Through an environment variable
Please refer to the list of Supported applications to learn which applications are part of Engine Yard and can be deployed to an instance through supported means.
Note: While many solutions for issues affecting these applications exist outside of the context of Engine Yard, Engine Yard has a very specific configuration, so be cautious when applying Stack Overflow solutions.
Sidekiq, Resque, and Delayed Job
These applications are Queue Management Systems (QMS), which means they are daemons that pick tasks from a queue to execute them. Multiple queues can coexist, and be searched by one or more workers. Each of them requires another application to run:
- Sidekiq depends on Redis
- ResQ depends on Redis
- Delayed Job depends on a SQL database.
These applications are managed and monitored by Monit and Systemd (v7 Sidekiq only), which will keep track of their CPU and memory usage. This means that the same strategies used for debugging the application server are valid for them.
CronJob
While CronJob is an application native to the system, it is important to be aware of the commands that can be used to debug it. Cronjobs can be displayed with the command crontab -l -u <username>
, with the following use cases being of importance in Engine Yard:
- System cronjobs
- Run under the root user, meaning they can be displayed by running the command
crontab -l -u root
- Related actions are reported under the system logs in
/var/log/syslog
- Run under the root user, meaning they can be displayed by running the command
- App cronjobs
- Run under the deploy user, meaning they can be displayed by running the command
crontab -l -u deploy
- Related actions are reported under the application logs in
/var/log/engineyard/
- Run under the deploy user, meaning they can be displayed by running the command
Managing the utility applications
The Utility applications deployed in Engine Yard are managed by Monit and Systemd, in a similar way as the app servers when deployed in an application instance. All are currently managed by Monit except for Sidekiq in v7, which uses Systemd.
The process to manage the applications is detailed in Managing Applications with Monit and Systemd.
Finding logs
While a full breakdown of available logs is in the Utility Instance Cheat Sheet, we can point to the following logs as having special relevance for debugging the utility applications:
Location | Description |
---|---|
/data/<app_name>/current/log/ |
Contains logs for the rails application under <environment_framework>.*.log. |
/var/log/engineyard/ |
Contains, potentially, logs used by the application: Passenger, PHP-FPM, etc. |
/var/log/monit.log | Internal Monit logs, showing its actions. |
Summary
This article provides a comprehensive guide to troubleshooting the main utility applications managed by the Engine Yard environment. It explains how these are managed and provides the location of the most relevant logs for addressing issues.
Priyanka Bhotika
Comments