MYSQL Optimize tables on Innodb in production environment advice
You can optimize a table without interrupting service by using pt-online-schema-change:

$ pt-online-schema-change --alter="ENGINE=InnoDB" --execute D=sakila,t=actor


Also, MySQL 5.6.17 supports OPTIMIZE as an online DDL change, allowing concurrent DML.