Optimising MySQL: how to cache data?
Hi everyone,
I have one MySQL database, witch contains some data, that i requesting on every client_connect. Can i cache it to somewhere, and reload cache on every map change? If it is, how can i do that ? It will increase plugin's performance ? |
Re: Optimising MySQL: how to cache data?
you can load your entire database at plugin_init() into variables, disconnect from mysql, then use the variables across your plugin, and yeah, it will improve some performance because the plugin isn't requesting mysql data every time and also the mysql doesn't require CPU power every time (affects server if it's on the same machine)... but it's a slight performance increase tough... but good also :)
|
Re: Optimising MySQL: how to cache data?
You can see here. I use SELECT, INSERT, UPDATE and the 2 ways to get data.
http://forums.alliedmods.net/showpos...&postcount=240 |
Re: Optimising MySQL: how to cache data?
But my table contains some usernames and passwords, and i authentificate them, and i don't know, how to do that from variables aka cache.
|
Re: Optimising MySQL: how to cache data?
on player connect set the variables...
Code:
new playerStuff[33] |
Re: Optimising MySQL: how to cache data?
I know, but i want to call mysql only on plugin_init(), not on each client_connect.
|
Re: Optimising MySQL: how to cache data?
If the DB is using SQLite, or the MySQL server is running on the same box as the server, you shouldn't notice a difference. You'll only be able to cache small databases or subsets of data, once it gets too big things will start to get slow and cumbersome, after all, storing the data is what SQL servers are optimized for, and exactly what AMXX is not made to do.
|
Re: Optimising MySQL: how to cache data?
I have only ~160 usernames and passwords. Is it too large amount of data to cache ?
|
Re: Optimising MySQL: how to cache data?
Quote:
|
Re: Optimising MySQL: how to cache data?
Does amxmodx admin_sql plugin caching admin's data ?
|
| All times are GMT -4. The time now is 08:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.