def start(self, redirect_output: bool = False, force: bool = False):
        """Start the server if it's not already running."""
        if self.is_running():
            return
            
        # Clean up port
        if not self._cleanup_port() and not force:
            raise RuntimeError(f"Port {self.port} is in use and could not be freed")

        # Set up logging
        stdout = stderr = None
        if redirect_output:
            log_dir = "logs"
            os.makedirs(log_dir, exist_ok=True)
            stdout = open(os.path.join(log_dir, f'{self.name}_server.log'), 'a')
            stderr = open(os.path.join(log_dir, f'{self.name}_server_error.log'), 'a')

        # Start the server process
        try:
            workers_amount = os.getenv("UPSONIC_WORKERS_AMOUNT", 1)
            if self.app_path == "upsonic.tools_server.server.api:app":
                workers_amount = 1
            
            cmd = [
                sys.executable, "-m", "uvicorn",
                self.app_path,
                "--host", self.host,
                "--port", str(self.port),
                "--log-level", "error",
                "--no-access-log",
                "--workers", str(workers_amount)
            ]
            
            self._process = subprocess.Popen(
                cmd, stdout=stdout, stderr=stderr, start_new_session=True
            )
            self._manage_pid_file("write")

            # Wait for server to start with optimized polling
            # Initial quick sleep to allow process to start
            time.sleep(0.1)
            
            # Progressive polling with increasing intervals
            poll_interval = 0.01
            max_poll_interval = 0.1
            start_time = time.time()
            while not self._is_port_in_use() and time.time() - start_time < 300:
                if self._process.poll() is not None:
                    raise RuntimeError(f"Server process terminated unexpectedly with code {self._process.returncode}")
                time.sleep(poll_interval)
                # Gradually increase polling interval
                poll_interval = min(poll_interval * 1.2, max_poll_interval)

            if not self._is_port_in_use():
                raise RuntimeError(f"Timeout waiting for {self.name} server to start")
                
        except Exception as e:
            self.stop()
            traceback.print_exc()
            raise RuntimeError(f"Failed to start {self.name} server: {str(e)}")
Start the server if it's not already running.
src/upsonic/server_manager.py