Normally I wouldn’t recommend bulk creating a MySites, but what if you were bringing ten thousand plus users onto your portal at a single time? Imagine if they all hit the My Site link within a small time frame, would your server melt?
Maybe you would like to bulk create the MySites at a time that suits you to avoid this meltdown.
The following code might help you out:
1: class Program
2: { 3: static void Main(string[] args)
4: { 5: using (SPSite site = new SPSite("http://my.sharepoint.url")) 6: { 7: ServerContext context = ServerContext.GetContext(site);
8:
9: //initialize user profile manager
10: UserProfileManager profileManager = new UserProfileManager(context);
11:
12: //this just creates a mysite for everyone in the profile database
13: foreach (UserProfile profile in profileManager)
14: { 15: Console.WriteLine("Creating a Personal Site for " + profile["PreferredName"] + "..."); 16: try
17: { 18: profile.CreatePersonalSite();
19: Console.Write("Succcess!\n"); 20:
21: }
22: catch (PersonalSiteExistsException)
23: { 24: Console.Write("Site already exists!\n"); 25: }
26: }
27: }
28: }
29: }
It simply iterates through each user profile and calls the CreatePersonalSite() method on each user profile.
Of course the other big issue to consider is the impact of the content databases, these should all be created and some thought should be given as to the potential size of these databases. If you say have 10000 users each with 100MB Quota your potentially looking at a 100GB database, which might be a little hard to work with. So you should have an idea of the total number of users, the quota size of each MySite and then setup the content database limits. These values can be viewed from the ‘Content Databases’ Option under ‘SharePoint Web Application Management’ in the Application Management section of central admin:

The above page will let you control how your sites are distributed across your databases.