Welcome Guest, Not a member yet? Register   Sign In
Toolbar slow on Raspberry Pi 1B and 3B (Docker/Alpine)
#1

(This post was last modified: 04-26-2023, 12:21 PM by Fred9176.)

Hi,

I'm migrating an old CI3 app to CI4.

This new app is hosted on Docker with Alpine 3.17 and php8.1.
On my laptop (with standard processor), everything runs fine.

But when I deploy my code to my Raspberry 3B (I first tried on Raspberry 1B where CI3 runs smoothly), everything started to get slow, with timeout.

After further investigation, I noticed that my code starts running fine, with good response time, as soon as I disable the debug toolbar (keeping development env and just disabling it in app/Config/Filters.php).

Do you have any idea where the problem can come from ?

Here is my dockerfile (maybe I miised to install a php extension ?).

Code:
FROM alpine:3.17.3

# Setup document root
WORKDIR /var/www/html

# Install packages and remove default server definition
RUN apk add --no-cache \
  curl \
  nginx \
  git \
  php81 \
  php81-fpm \
  php81-intl \
  php81-mysqli \
  php81-mbstring \
  php81-opcache \
  php81-session \
  php81-curl \
  php81-phar \
  php81-tokenizer \
  php81-ctype \
  php81-calendar \
  supervisor


# Configure nginx - http
COPY config/nginx.conf /etc/nginx/nginx.conf
# Configure nginx - default server
COPY config/conf.d /etc/nginx/conf.d/

# Configure PHP-FPM
COPY config/fpm-pool.conf /etc/php81/php-fpm.d/www.conf
COPY config/php.ini /etc/php81/conf.d/custom.ini

# Configure supervisord
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /var/www/html /run /var/lib/nginx /var/log/nginx /etc/supervisor/conf.d/ /etc/php81 /etc/nginx

# Switch to use a non-root user from here on
USER nobody

# Add application
COPY --chown=nobody src/ /var/www/html/

# Expose the port nginx is reachable on
EXPOSE 80

# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1/fpm-ping


Thanks for your help.

Fred
Reply
#2

Did you do Initial Configuration?
See https://codeigniter.com/user_guide/insta...figuration
Reply
#3

(04-25-2023, 05:33 PM)kenjis Wrote: Did you do Initial Configuration?
See https://codeigniter.com/user_guide/insta...figuration

Yes, baseUrl is set.
I tried setting it in .env, app/Config/App.php and even set it dynamically with constant in app/Config/Constants.php, but this doesn't have any effect.

i don't know why this is important specifically for the toolbar as the code seems to be embedded in the page itself (which takes 16s to load on RPI3 vs 200ms when disabled).
Reply
#4

(This post was last modified: 04-26-2023, 12:15 AM by kenjis.)

Just to confirm, that property is baseURL, not baseUrl.

But you did set in app/Config/App.php. A setting mistake is not likely to happen.

Do you see the debug toolbar?
Reply
#5

(04-26-2023, 12:11 AM)kenjis Wrote: Just to confirm, that property is baseURL, not baseUrl.

But you did set in app/Config/App.php. A setting mistake is not likely to happen.

Do you see the debug toolbar?

I confirm it is correctly set (and this is confirmed by the fact that my links created with base_url() change accordingly) .

The debug toolbar is correctly displayed as well, but with very long time, as mentionned.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB