Most people I've seen in this situation seem to fall somewhere between "not doing it all in one year holy cow the taxes!" and "probably want to get it done in less than a decade let's just git 'er done".
It probably depends on your tolerance and capacity for risk, the volatility and risk in your tech stocks, how concentrated you are in those two stocks relative to your overall portfolio, your relative tax rates now and after you stop working, how big of a mortgage you have, whether the mortgage is fixed or variable, how many years left you have on the mortgage, and probably other things I'm forgetting about.
There's probably no optimal answer, especially not one determinable in advance. I'd probably pick a tax bracket that you're comfortable staying within that would get the job done in a time frame that seems acceptable to you. Maybe start with how long it would take you to pay it off if you stayed within the 0% or 15% LTCG bracket, and see if that's too long. If it's too long, then maybe add a year or two up front of going higher.
If a large number of the shares are short term (unlikely but possible), then of course look at the ordinary income tax brackets that would apply.
At those levels, you'll also want to look at and consider the impact of NIIT and AMT if either apply to you.