In this paper, we study a manufacturing system of serial stages with general service times, in which the production of each stage and the coordination of stages are controlled by Kanban discipline. This Kanban discipline is modeled as a Discrete Event Dynamic System and a system of recursive equations is applied to study the dynamics of the system. The recursive relationship enables us to compare this Kanban discipline with the other blocking disciplines such as transfer blocking, service blocking, block-and-hold b, and block-and-hold K, and the Kanban is shown to be superior to the other disciplines in terms of makespan and throughput. As a special case, two stages Kanban system is modeled as $C_2/C_2/1/N$ queueing system, and a recursive algorithm is developed to calculate the system performance. In optimizing the system performance, the stochastic optimization approach of Robbins-Monro is employed via perturbation analysis, the way to estimate the stochastic partial derivative based on only one sample trajectory of the system, and the required commuting condition is verified. Then the stochastic convexity result is established to provide second-order optimality condition for this parametric optimization problem.