very slow queries ~30 seconds #3791
-
Hey Guys, I've upgraded from yourls v1.5 to v1.9.2 , and also from PHP 7.4 to PHP 8.2 My queries to convert short urls to long urls in specific are slow now. I have 5.5 million rows, when I check my database processes it shows "Waiting for table level lock". I've been reading similar issues to find a fix, I saw something about people fixing it regarding DNS issues and resolve.conf, but unsure of how they fixed or disabled DNS checks. I'm really stuck here, and unsure how to fix :/ could really use some help or guidence on optimizations, maybe some common config errors people make that slow down queries? I will post my debug tomorrow to help you help me :) Thanks friends. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
debug: Also I added Another query I see running a lot and seems to lock the table until it's done is: I'm using no plugins by the way, any help or nudge in the right direction will really be appreciated @ozh @dgw , thanks. |
Beta Was this translation helpful? Give feedback.
-
@dgw, what would be the impact if one does the below directly on the database?
Would that break the code? Asking because this is a fairly simple change anyone can do without touching code. Of course, selecting X is key, but nothing that a We, for example, have an instance running for years with almost 500K URLs in the DB. URLs structure is predictable and won't change. However, the maximum length of an URL we have today is 251 which is pretty manageable for a MariaDB/MySQL index, even if we double that length. If we could be confident that such change would have no impact in the code, we would have done that already. |
Beta Was this translation helpful? Give feedback.
So I've decided to set
define( 'YOURLS_UNIQUE_URLS', false );
because my urls by design should already be unique. And I'm running very fast now, processes dont even show up on mysql process list.I'm still curious of the implications of disabling unique urls @ozh @dgw if you could please just tell me what I should keep an eye on in regards to duplicate problems plzzz :) anyways great software thanks.