What does "cleaning up" mean in MySQL InnoDB transaction status and how to prevent it?
To quote the man himself:


  Hi!
  
  Yes, you can get processes in the 'cleaning up' state if your
  table_cache is too small.
  
  The general answer is that you should increase your table cache if the
  status variable 'opened_tables' tend to increase a lot over time.
  
  Yours,
  Monty


Source: Grokbase.com