litespeedtech / lsws-docker-env

LiteSpeed Enterprise Docker Environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newrelic for LSWS

PiotrCzapla opened this issue · comments

I've setup newrelic for the performance monitoring of php and mysql, I was would love to collect the cache utilisation and the throughput from LSWS. Similar to what i would get for nginx or apache. Can I somehow get using apache mod_status?
The way LSWS works in apache compatible mode is still really fuzzy right now.
I would like to try ot setup this monitor: https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/apache-monitoring-integration

btw I've spent quite a bit configuring newrelic as the docs are really poorly written.
Maybe it will be worth adding some info how to do it to the docs?

Here is a quick setup

litespeed.dokerfile

from litespeedtech/litespeed:5.4.10-lsphp74

RUN \
  curl -L https://download.newrelic.com/php_agent/release/newrelic-php5-9.14.0.290-linux.tar.gz | tar -C /tmp -zx && \
  export NR_INSTALL_USE_CP_NOT_LN=1 && \
  export NR_INSTALL_SILENT=1 && \
  /tmp/newrelic-php5-*/newrelic-install install && \
  rm -rf /tmp/newrelic-php5-* /tmp/nrinstall* && \
  sed -i \
      -e 's/"REPLACE_WITH_REAL_KEY"/"<FILL THE LICENSE KEY HERE>"/' \
      -e 's/newrelic.appname = "PHP Application"/newrelic.appname = "<PUT YOUR APP NAME HERE>"/' \
      -e 's/newrelic.daemon.start_timeout.*/;newrelic.daemon.start_timeout=5s/' \
      -e 's/;newrelic.daemon.address =.*/newrelic.daemon.address =newrelic_php:31339/' \
      /usr/local/lsws/lsphp74/etc/php/7.4/mods-available/newrelic.ini

The one need to add php deamon as a separate container to the docker compose:

  newrelic_php:
    image: newrelic/php-daemon:latest
    depends_on:
      - "litespeed"

Setting up mysql monitoring is more complex. I can write that up as well if you are interested in putting that to the docs or as an example scripts.

Hi @PiotrCzapla ,

It seems like your original question was related to Newrelic Infrastructure, for Webserver Monitoring.
But the second one is related to PHP, I'll answer in regards to both.

For the Webserver, there is no integration currently similar to mod_status of Apache with Litespeed Enterprise or OpenLitespeed. For PHP, it indeed looks like the wiki is outdated, we are in process of moving our docs to a new website(docs.litespeedtech.com) and I will update the new tutorial with latest data.

Thank you very much for that setup information you provided above, I will include that for Docker installation, If you wish to contribute for MySQL, we will be happy to include that aswell.

Best Regards
Shivam
Litespeed Technologies