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

Add apache dockerfile #32

Merged
merged 7 commits into from
Aug 24, 2023
Merged

Add apache dockerfile #32

merged 7 commits into from
Aug 24, 2023

Conversation

joanhey
Copy link
Contributor

@joanhey joanhey commented Jul 28, 2023

I don't use apache for a lot of years ago.
And I don't want to install it only for the bench and less in port 80, and perhaps more people have the same situation.

Advantages of use Docker:

  • We don't need apache installed in our computer
  • Not necessary to copy, chown or change apache config
  • Use default php:8.2-apache
  • We can change to any PHP version easily in the dockerfile
  • Don't pollute the hard disk with logs
  • Instant display of errors and logs (easier for developers)
  • It's optional, you can use your apache instead

First I needed to fix the permissions nightmare, thanks to the docker.
Still I didn't run any benchmark :(, only check.sh. Perhaps tonight I will run this benchmark 😄 .

PD: it's in dir .docker because I have another with nginx.

Work in progress!

@joanhey
Copy link
Contributor Author

joanhey commented Jul 29, 2023

This morning I ran this benchmark locally, the first time 😀 . Without OPCache and with the docker.
image

With OPCache
image

for performance reasons
@myaaghubi myaaghubi changed the base branch from v2.2 to dev August 1, 2023 07:19
@myaaghubi myaaghubi deleted the branch myaaghubi:dev August 2, 2023 15:41
@myaaghubi myaaghubi closed this Aug 2, 2023
@myaaghubi myaaghubi reopened this Aug 2, 2023
@myaaghubi
Copy link
Owner

Is it still in progress?
It is helpful to share some information about your benchmarking environment besides the results.

@joanhey
Copy link
Contributor Author

joanhey commented Aug 10, 2023

In my PC the results are very low.
It can be the php official docker (not the first time that have very low performance), and I can change it to use a Ubuntu or Debian docker, and install the Apache and PHP.

@joanhey
Copy link
Contributor Author

joanhey commented Aug 10, 2023

The Readme say that you use Apache, but not which type of configuration: mod_php, php_fpm, mpm prefork, ....

@joanhey
Copy link
Contributor Author

joanhey commented Aug 10, 2023

The results graph that I sent are with OPCache On, and are similar to your results without OPCache.
My CPU is very similar to yours: Intel i7-6700 (8) @ 4.000GHz.

WRK --timeout

Also we need to change the WRK config to add --timeout , In slow computers or with this docker some requests use more than 2 seconds, the default in WRK. I think than need to be from 4-8 seconds. 2 seconds is for tests static content, not dynamic. /wg/wrk/issues/177
In Thechempower benchmark we use 8 seconds.

image

Nginx dockerfile

With the nginx dockerfile, the results are an exaggerate difference. (both use OPCache)
Example with Kumbia, but it's the same with all frameworks.

Apache dockerfile 148.839 req

image

Nginx dockerfile 1.046.629 req

image

@joanhey
Copy link
Contributor Author

joanhey commented Aug 10, 2023

Every time I run a new benchmark overwrite the old data: local, apache docker, nginx docker, ...
It's for that I ask to add datetime in the issue #37

@myaaghubi
Copy link
Owner

By default it is prefork for Apache2, all configurations are the default for Apache & PHP
It is a simple hello world not a templated big script, however I got some timeout requests for some of the libs even with a 5-8 seconds timeout
You have a better cpu so higher scores are expected, docker is limiting, also faster libs gonna lose more scores on a hard disk so disabling CustomLog for apache2 or access_log for nginx is necessary

@joanhey
Copy link
Contributor Author

joanhey commented Aug 11, 2023

I think that will be better to add a docker branch, and when it's well tested, we can merge in the main branch.

@myaaghubi myaaghubi changed the base branch from dev to docker August 12, 2023 19:40
@joanhey
Copy link
Contributor Author

joanhey commented Aug 18, 2023

Now you can merge it in the docker branch, so all can test it.
Later I'll send the nginx dockerfile, and it's x100 faster than the apache dockerfile.

I'll try with a new dockerfile for apache, using a Ubuntu image and installing all the required components.

@myaaghubi
Copy link
Owner

I will check it as soon as possible. For nginx consider #39 and plz make sure to add a more understandable name on apache.sh for users

@myaaghubi myaaghubi changed the base branch from docker to dev August 24, 2023 07:31
@myaaghubi myaaghubi merged commit a9e36d5 into myaaghubi:dev Aug 24, 2023
2 checks passed
@joanhey joanhey deleted the docker-apache branch August 24, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants