What is /system/bin/mediaserver on Android, and why is it pegging the CPU? I noticed that my Motorola Droid, running rooted 2.2 Froyo, has been acting sluggish sometimes.  I fired up the terminal emulator, and ran top, and noticed that /system/bin/mediaserver is using around 90% of my CPU.

What does this program do? Is it safe to kill it?  How can I prevent it from slowing down my phone in the future?

Some quick Googling has turned up other people with the same problem, but not really any answers.
The media server is responsible for indexing the images, videos and music files on the device. It then is queried by programs like the media gallery or the music player for filtered lists of certain media types. 

I think that it would be restarted pretty fast after killing. I would assume that somehow there are many write options on the sd card and the media server will constantly reindex your mass storage. But I don't know a solution for that.