Authors proposed IoT device virtualization technology using edge computing. In IoT device virtualization, IoT service is divided into multiple micro service functions, and these functions are allocated to computing resources that are located in the networks. In this paper, we study an optimal service function allocation method that minimizes application end-to-end latency. Through computer simulations, we confirm an effectiveness of the optimal allocation method.