| 160 | |
| 161 | Q: My auth server used to be fast, but now it's slower and slower, even under no load |
| 162 | |
| 163 | A: You have to: |
| 164 | |
| 165 | 1. Run VACUUM ANALYSE often from a script (it's a very cheap, non locking operation, and considering wifidog's very write heavy SQL mix, runing it every hour isn't excessive). |
| 166 | 1. Make sure the above script works. |
| 167 | 1. If you see you auth server getting progressively slower, run VACUUM FULL ANALYSE once, and GO TO STEP 2. |
| 168 | |
| 169 | Explanation: If you run VACUUM ANALYSE regularily (every night or every hour) you shouldn't need VACUUM FULL ANALYSE. However, if you haven't run VACUUM ANALYSE for a long time, you have to run VACUUM FULL ANALYZE once. |
| 170 | |
| 171 | What happens is that without VACUUMing the connection and node tables grows and grows (because they are written to frequently, and postgres being a true ACID database, keep past versions of tuples to insure read consistency). Simply vacuuming doesn't reclaim the space used by old tuples, it just makes them available for reuse. If you haven't run VACUUM in a long time, you probably have millions of free tuples that you would, never, ever |
| 172 | use up in a single day. VACUUM FULL ANALYZE fixes that. |