This article walks you through step by step on creating and configuring
My Sites for SharePoint 2016. Although this article aims at SharePoint
2016, same steps are applicable to SharePoint 2013 as well.

Prerequisites:
Before you create My Sites in SharePoint, you need to have the following services properly configured.

User Profile Service application - SharePoint My Sites depends on UPS! User Profile Service Application will be used to map the My Sites with the User Profiles.

Managed Metadata service application - My Site users Keywords! so have MMS created & configured prior setting up My Sites.

Search service application - not mandatory, but best practice for people search results!

Also make sure User Profile Service Application, Managed Metadata Service, and Search Service Application are up running and they are connected to your My site web application through service connections in Central Admin.

Step 1: Create New web application for My Sites

Although you can use an existing web application, its a best practice to create a dedicated web application for My sites for reasons like security, performance, etc. So, To start with, lets create a dedicated web application to host our my sites in SharePoint 2016.

Step 2: Add new managed path to the My Site Web Application:

Managed paths defines the location to host site collections within a web application.In our environment, When SharePoint users provision their My Sites, we would like them to reside at http://mysite.crescent.com/personal/name-of-person/. So, We defined a wildcard managed path for "/personal/" as follows:

In the ribbon click the Managed Paths button >> Define Managed Paths dialog, Add a new path called "personal" (or "my" or whatever you like!) and make it Wildcard inclusion. Click "Add Path" and then OK once done.

Optionally, You can delete the OOTB "Sites" managed path from My site web application.

Step 3: Enable self-service site creation for the web application

Self-service site creation option enables the end user to create their own My site collection automatically.

Perform this step only when you want your users to create subsites under my site site collection. Create a permission level policy with "Create Subsites" rights.

Select your My Site web application and Click on the "Permission Policy" button from the ribbon. In the "Manage Permission Policy Levels", click on "Add Permission Policy Level" link.

Under Permissions, scroll to Site Permissions, select the Grant option for "Create Subsites - Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites". Now, the new permission policy level should appear among other policy levels.

You need to grant that policy level to all users. Highlight your my site web application, Click on the "User Policy" button from the ribbon.

Step 5: Configure My Site URL in the User Profile Service Application

Alright, Now you have a My Site Web Application, My Site Host root site collection, wildcard managed path and self-service enabled for the web application. The only remaining thing would be to set up My Site URL on User Profile Service Application, So that user profile service knows where to create new site collections for user My Sites.

By default, The maximum number of site collections created per content database is 5000. If you are planning for 10,000 My Sites, of 100 GB each you'll need 1000 TB disk space! So, plan to adhere Content database sizing recommendation - 200 GB or less per content database for better performance.