Skip to content

Conversation

@AkameOuO
Copy link
Contributor

@AkameOuO AkameOuO commented Mar 5, 2025

Pull Request for Issue #

Summary of Changes

replace ping() with stat() !== false.

Testing Instructions

MysqliDriver::connected() should work.

Documentation Changes Required

@HLeithner
Copy link
Contributor

Need to be checked if this is an performance issue, because this function is called for each sql query. So the overhead needs to be checked.

@AkameOuO
Copy link
Contributor Author

AkameOuO commented Mar 6, 2025

Tested on localhost with php 8.4.4 and mysql 8.1.
ping() spent 0.343s for 10000 calls and stat() spent 0.342s for 10000 calls.
I think it's ok

@HLeithner
Copy link
Contributor

Can you please test on the network with a second Computer please.

@AkameOuO
Copy link
Contributor Author

AkameOuO commented Mar 6, 2025

Ok. I Tested again with a remote database on AWS and local php server.
ping() spent 19.122s for 100 calls and stat() spent 19.110s for 100 calls.

P.S. It's about 190ms ping to the remote computer

@HLeithner
Copy link
Contributor

ok thanks, seems that ping did the same as stat();

@HLeithner
Copy link
Contributor

but much more interesting would be to get rid of this completely, Just thinking about using mysqli_report in exception mode and catch missing connections an retry after connect.... maybe another pr

@brianteeman
Copy link
Contributor

just came across this when running the joomla integration tests

@richard67 richard67 changed the title mysqli::ping is deprecated since php8.4 [3.x] mysqli::ping is deprecated since php8.4 Mar 23, 2025
@richard67 richard67 merged commit edb6e60 into joomla-framework:3.x-dev Apr 20, 2025
2 checks passed
@richard67
Copy link
Contributor

Thanks @AkameOuO and reviewers.

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.

5 participants