bearing in mind that the perimeter of two similar figures are at a ratio, which is the same ratio is their sides.
[tex]\bf \cfrac{\textit{small octagon}}{\textit{large octagon}}\qquad \cfrac{perimeter}{perimeter}\implies \cfrac{24}{32}\implies \cfrac{3}{4}\implies 3:4 \\\\\\ \cfrac{\textit{small octagon}}{\textit{large octagon}}\qquad \cfrac{side}{side}\qquad \cfrac{x}{6}=\cfrac{3}{4}\implies 4x=18\implies x=\cfrac{18}{4}\implies x=\cfrac{9}{2}[/tex]