A cooperative vehicle-infrastructure system (CVIS) can provide perception information beyond the visual range for autonomous vehicles via roadside directional sensors, such as cameras, millimeter-wave radar, and lidar. The performance of roadside perception strongly depends on sensor placement, where physical occlusion between vehicles is inevitable. This paper proposes an occlusion degree model (ODM) to describe the dynamic occlusion between sensors, obstacles, and targets in a three-dimensional space. The ODM is then integrated with microscopic traffic simulation to study the impacts of traffic density, vehicle model composition, and sensor configurations on vehicle detection and tracking performances. Based on the simulation, a multifactor regression model with a logistic growth curve is established to quantify the performance of roadside sensors with different factors, where the evaluation metrics are rigorously designed. Finally, an optimization model of roadside sensor placement with non-linear constraints is formulated to reduce the construction cost under a coverage constraint and improve the perception accuracy within budget limitations. A case study of a highway scenario shows that the performance of the proposed approach improves by 5.63%, 6.55%, and 8.01%, respectively, under the worst possible condition with accuracy requirements of 0.97, 0.96, and 0.95 compared with the conventional placement scheme. The study provides a map of the performance of roadside perception with different influencing factors and guides the optimal roadside sensor placement for a CVIS.