Putting the other answers all together, here's a command line that will work:
env vblank_mode=0 __GL_SYNC_TO_VBLANK=0 glxgears
This has the advantages of working for both Mesa and NVidia drivers, and not requiring any changes to configuration files.