Precision modulation of gut microbiota requires elucidation of the relation between dietary fiber intake and gut microbe dynamics. However, current studies on this aspect are few due to many technical limitations. Here, we used Caenorhabditis elegans to minimize the complicated host-microbial factors and to find the relation between dietary fiber chemical structures and gut microbiota dynamics. The Allium schoenoprasum polysaccharide ( As sP) structure was elucidated and used as the complex dietary fiber against the simple fiber inulin. In vitro bacterial growth and genome analysis indicated that As sP supports bacterial growth better than inulin, while in vivo gut microbiota analysis of C. elegans fed with As sP showed that microbiota richness increased significantly compared with those fed with inulin. It is concluded that the more complex the dietary fiber chemical structure, the more gut bacteria growth it supports. Together with the community bacterial interactions that alter their abundances in vivo, these factors regulate gut microbiota synergistically.