Question : How long do most people visit San Francisco?
Answer : Of course you're not most people, but if you were, you'd stay roughly 30 days.
Question : Would you be willing to change your travel days if it saved you money?
Answer : The cheapest day to fly in October is Sunday. Being flexible with your travel days garners even more savings during booking.