Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitnami/laravel is slower than non-docker Laravel #64956

Closed
drice82 opened this issue Apr 8, 2024 · 6 comments
Closed

bitnami/laravel is slower than non-docker Laravel #64956

drice82 opened this issue Apr 8, 2024 · 6 comments
Assignees
Labels

Comments

@drice82
Copy link

drice82 commented Apr 8, 2024

Name and Version

bitnami/laravel:10 (laravel 11 doen't test)

What is the problem this feature will solve?

bitnami/laravel is slower than non-docker Laravel

What is the feature you are proposing to solve the problem?

My testing process is as follows:

  • Bitnami/laravel + Bitnami/mariadb: slow
  • Bitnami/laravel + AWS light sail RDS: slow
  • Bitnami/laravel + Mariadb(by Cloudpanel): slow
  • Laravel in Cloudpanel(LNMP) + Bitnami/mariadb: normal
  • Laravel in Cloudpanel(LNMP) + AWS lightsail RDS: normal

Definition of slow: 3-5s to open a new page.
Definition of normal: 1s to open a new page.

Build my own docker image, based on Bitnami/laravel, copy my web into the image, but the result is still slow.

@github-actions github-actions bot added the triage Triage is needed label Apr 8, 2024
@github-actions github-actions bot removed the triage Triage is needed label Apr 9, 2024
@github-actions github-actions bot assigned gongomgra and unassigned carrodher Apr 9, 2024
@gongomgra
Copy link
Contributor

gongomgra commented Apr 16, 2024

Hi @drice82,

Can you give us more information on the testing application you are running? I launched a fresh new EC2 instance, and run our bitnami/laravel:10: and bitnami/mariadb:11` containers from a docker-compose file to test. Inside the laravel container I installed the sample laravel-vue-ecommerce project on it.

I have navigated through the website without issues, added products to the cart, etc. Although it is true the first connection took a bit longer than expected, the rest of requests were fast (probably while the Laravel app was creating its internal cache).

Screenshot 2024-04-16 at 13 56 13

Here are also the php artisan serve logs.

root@af9121b4f8e4:/opt/laravel-vue-ecommerce# php artisan serve --host 0.0.0.0 --port 8000 -vvvvv

   INFO  Server running on [http://0.0.0.0:8000].

  Press Ctrl+C to stop the server

  2024-04-16 11:43:06 ................................................................................................. ~ 1s
  2024-04-16 11:43:07 /css/app.css .................................................................................... ~ 0s
  2024-04-16 11:43:07 /js/app.js ...................................................................................... ~ 1s
  2024-04-16 11:43:08 ................................................................................................. ~ 1s
  2024-04-16 11:43:09 /images/MobileLogo.svg?d0cb2f2a087d322fda99dbfed23efe11 ......................................... ~ 0s
  2024-04-16 11:43:09 /images/Logo.svg?83eef76f698f6bf6b4a349895f928699 ............................................... ~ 0s
  2024-04-16 11:43:09 /images/Cart.svg?ea6d80008929415ec7bb42c40a571d4e ............................................... ~ 0s
  2024-04-16 11:43:09 /images/Hero.jpg ................................................................................ ~ 0s
  2024-04-16 11:43:10 /favicon.ico .................................................................................... ~ 0s
  2024-04-16 11:43:24 ................................................................................................. ~ 0s
  2024-04-16 11:43:26 ................................................................................................. ~ 0s
  2024-04-16 11:43:26 /favicon.ico .................................................................................... ~ 0s
  2024-04-16 11:43:32 /favicon.ico .................................................................................... ~ 0s
  2024-04-16 11:43:32 /images/Remove.svg?098f636e7eb11df6ee16bd2033d7de95 ............................................. ~ 0s
  2024-04-16 11:43:47 ................................................................................................. ~ 0s
  2024-04-16 11:43:47 /favicon.ico .................................................................................... ~ 0s
  2024-04-16 11:43:47 /images/Hero.jpg ................................................................................ ~ 0s
  2024-04-16 11:43:49 ................................................................................................. ~ 0s
  2024-04-16 11:43:49 /favicon.ico .................................................................................... ~ 0s
  2024-04-16 11:43:53 ................................................................................................. ~ 0s
  2024-04-16 11:43:54 ................................................................................................. ~ 0s
  2024-04-16 11:43:54 /favicon.ico .................................................................................... ~ 0s
  2024-04-16 11:43:58 /favicon.ico .................................................................................... ~ 0s
  2024-04-16 11:45:02 /css/app.css .................................................................................... ~ 0s
  2024-04-16 11:45:02 /js/app.js ...................................................................................... ~ 1s
  2024-04-16 11:45:04 ................................................................................................. ~ 0s
  2024-04-16 11:45:04 /images/Logo.svg?83eef76f698f6bf6b4a349895f928699 ............................................... ~ 0s
  2024-04-16 11:45:04 /images/MobileLogo.svg?d0cb2f2a087d322fda99dbfed23efe11 ......................................... ~ 0s
  2024-04-16 11:45:04 /images/Hero.jpg ................................................................................ ~ 0s
  2024-04-16 11:45:04 /favicon.ico .................................................................................... ~ 0s

@drice82
Copy link
Author

drice82 commented Apr 17, 2024

For a fairer test, I created the following environment:
DB: AWS lightsail RDS, MySQL database (8.0.36), 1 GB RAM, 2 vCPUs, 40 GB SSD, all the test connect to this DB.
And create a lightsail instances to install Cloudpanel(LNMP) and Docker to run Laravel. run on the same server.
The instance is 2 GB RAM, 2 vCPUs, 60 GB SSD, OS is Debian11
The laravel is my own project, it is laravel+Adminlte.
I click the page from page1 to page 15, and record the page 15 result as below:
this is LNMP:
s1

This is Bitnami/Laravel
f1

I only post 2 results, but actually when i click other pages, the result are similar, LNMP takes about 1s to open a new page, and Bitnami/Laravel takes about 4s.

I did similar test in other environment, like Linode server, and tried use Bitnami/Laravel on Lightsail container. But the result was similar.
I tried other Laravel application, also design by myself, the result also similar.

@drice82
Copy link
Author

drice82 commented Apr 19, 2024

@gongomgra
I tried other nginx-php-fpm docker image, it works well with my application. I think the difference is that the nginx-php-fpm image uses nginx as the HTTP server, and bitnami/Laravel uses PHP’s built-in development server as HTTP server.

@gongomgra
Copy link
Contributor

Hi @drice82,

Thanks for your message. I agree the performance differences may be related to the Bitnami Laravel container not including a web server like Apache or NGINX but relying on Laravel's HTTP server.

Copy link

github-actions bot commented May 5, 2024

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label May 5, 2024
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants