Counting pageviews on high-traffic cached sites

It really depends what you need to view counts for – if it’s just for seeing traffic stats, then use Google Analytics or any number of javascript tracker based analytics tools.

If you need integration of page view counts and the ability to do things like order post by views, then you can either

  • spend some time optimising your database – some options and things to consider
    • more memory for MySQL
    • change the postmeta table to be InnoDB
    • get a separate database server
    • make sure you’ve tuned your MySQL settings (use mysqltuner as a starting point)

OR

  • Use something like Piwik and spend time integrating it (it has a decent API) with WordPress.