We give sufficient conditions for subsets to be precompact sets in variable Morrey spaces. Then we obtain the boundedness of the commutator generated by a singular integral operator and a BMO function on the variable Morrey spaces. Finally, we discuss the compactness of the commutator generated by a singular integral operator and a BMO function on the variable Morrey spaces.