8000 Performance not ideal during short URL creation · Issue #2428 · shlinkio/shlink · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Performance not ideal during short URL creation #2428

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

Closed
jeboehm opened this issue May 4, 2025 · 5 comments
Closed

Performance not ideal during short URL creation #2428

jeboehm opened this issue May 4, 2025 · 5 comments
Labels

Comments

@jeboehm
Copy link
jeboehm commented May 4, 2025

Shlink version

stable

PHP version

8.4.5

How do you serve Shlink

Docker image

Database engine

MySQL

Database version

n/a

Current behavior

I was wondering about slow response times of my Shlink instance on a Kubernetes stack, so I checked the PHP configuration of the Shlink image.
I discovered that the OPCache extension is not installed, although it is explicitly activated in https://github.com/shlinkio/shlink/blob/develop/config/roadrunner/.rr.yml.

/etc/shlink $ php -m |grep -i opcache

Expected behavior

OPCache should be installed.

Minimum steps to reproduce

/etc/shlink $ php -m |grep -i opcache

@acelaya
Copy link
Member
acelaya commented May 5, 2025

I'm happy to merge #2429, but just have in mind that RoadRunner bootstraps the app only once and the code is in memory in any subsequent requests anyway, so I wouldn't expect a big performance impact (if at all).

Opcache makes more sense when serving Shlink using a traditional web server, where the code is bootstrapped and loaded from the filesystem to memory on every request.

Perhaps if you can elaborate what you mean by "slow response times", we can expand on #2293 and find a different potential bottleneck.

@acelaya
Copy link
Member
acelaya commented May 6, 2025

I tested #2429, and I can confirm there doesn't seem to be a big difference in execution time, probably because of what I explained above.

I wonder why RoadRunner mentions opcache in a few places (the fact that is referenced in .rr.yml is mainly because they generate it like that and I never removed it). On the other hand, they don't seem to promote clearly on the side of using or not using it.

@jeboehm
Copy link
Author
jeboehm commented May 7, 2025

Damn. I have about 200 ms when creating a short link. In this case I could imagine my database becoming a bottleneck.
Thanks for testing!

@acelaya
Copy link
Member
acelaya commented May 7, 2025

Creating a short URL requires a bunch of checks, especially depending on the options you send, so it's one of the heaviest actions you can make.

I don't think 200ms is terrible, but there's definitely room for improvement. If you can share more details on your setup, I could try to see where the bottleneck is when creating a short URL.

There might be some missing index or some operation that can be skipped in certain scenarios.

@acelaya acelaya changed the title OPCache extension missing Performance not ideal during short URL creation May 7, 2025
@acelaya
Copy link
Member
acelaya commented May 19, 2025

Closing this for now. I'm happy to continue investigating possible performance issues if more details to reproduce are provided

@acelaya acelaya closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2025
@github-project-automation github-project-automation bot moved this to Done in Shlink May 19, 2025
@acelaya acelaya removed this from Shlink Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0