I need something like TEVS, but static.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gambrinus
    So Fucking Banned
    • Jun 2007
    • 740

    #1

    I need something like TEVS, but static.

    I like TEVS, it does its job nicely, but these dynamic pages are killing my box. The load is brutal at 100k a day, its killing my ability to grow.

    I need something TEVSesque but that generates static pages. I dont even need bulk import functionality, user uploads, any of that crap.

    Something that just takes sponsor embed code, add some text, a title, and it shits out an html page with the aforementioned input.

    Anything?
  • HorseShit
    Too lazy to set a custom title
    • Dec 2004
    • 17513

    #2
    what kind of hardware are you running

    Comment

    • Gambrinus
      So Fucking Banned
      • Jun 2007
      • 740

      #3
      hw.model: Intel(R) Pentium(R) 4 CPU 2.80GHz
      hw.ncpu: 2
      hw.physmem: 1059479552
      hw.usermem: 738578432

      Comment

      • HorseShit
        Too lazy to set a custom title
        • Dec 2004
        • 17513

        #4
        hit me up

        Comment

        • Tjeezers
          Webmaster
          • Mar 2007
          • 16604

          #5
          You can make TEVS static... I did it.. you can do it too.

          Get 43 FREE Backlinks when joining SWAG Live - Click my banner to get the links!

          Comment

          • Gambrinus
            So Fucking Banned
            • Jun 2007
            • 740

            #6
            Tell me how to make tevs static, please.

            Comment

            • Tjeezers
              Webmaster
              • Mar 2007
              • 16604

              #7
              oke, give me a moment, opening dreamweaver to grab the codes

              Get 43 FREE Backlinks when joining SWAG Live - Click my banner to get the links!

              Comment

              • Gambrinus
                So Fucking Banned
                • Jun 2007
                • 740

                #8
                you fuckin rule.

                Comment

                • Tjeezers
                  Webmaster
                  • Mar 2007
                  • 16604

                  #9
                  First Step - Create a php page called cache.php
                  and dump this code in it....

                  Code:
                  <?
                  /**
                   * Cache - Output caching
                   * @package Cache
                   * @author degro
                   * @copyright 2008 Harry Varwijk - AWMS-Network.com
                   */
                  class Cache
                  {
                  
                  	function Cache($path, $disable=false, $disable_output=false)
                  	{
                  		if(!is_dir($path))		trigger_error("Path is not directory!", E_USER_ERROR);
                  		if(!is_writable($path))	trigger_error("Path is not writable!", E_USER_ERROR);
                  
                  		if(!in_array(substr($path,-1),array("\\","/"))) $path.="/";
                  		
                  		$this->path = $path;
                  		$this->disable = (bool)$disable;
                  		$this->disable_output = (bool)$disable_output;
                  		$this->stack = array();
                  		
                  		$this->output = null;
                  	}
                  	
                  	function _output($output)
                  	{
                  		$this->output = $output;
                  		if(!$this->disable_output) echo $output;
                  	}
                  
                  	function _load($file,$time)
                  	{
                  		$filename = $this->path.$file;
                  		
                  		if($this->disable) return false;
                  		if(!file_exists($filename)) return false;
                  		
                  		$f = fopen($filename, "r");
                  		$fstat = fstat($f);
                  		fclose($f);
                  
                  		if(time()-$fstat['mtime']>$time) return false;
                  		
                  		return file_get_contents($filename);
                  		
                  	}
                  
                  	function _start($file,$time)
                  	{
                  
                  		$data = $this->_load($file,$time);
                  		if($data===false)
                  		{
                  			$this->stack[count($this->stack)] = $file;
                  			ob_start();
                  			return count($this->stack);
                  		}
                  		
                  		$data = $this->_unpack($data);
                  		
                  		$this->_output($data['__output__']);
                  		
                  		return $data;
                  	}
                  
                  	function _unpack($data)
                  	{
                  		return unserialize($data);
                  	}
                  
                  	function _pack($data)
                  	{
                  		return serialize($data);
                  	}
                  	
                  	function save($file,$time,$data=array())
                  	{
                  
                  		if($this->disable) return false;
                  
                  		$time = (int)$time;
                  		if(!$file) trigger_error("n-am fisier", E_USER_ERROR);
                  		if($time<1) trigger_error("timpul trebuie sa fie mai mare de 0", E_USER_ERROR);
                  		
                  		if(count($this->stack) && $file == $this->stack[count($this->stack)-1])
                  		{
                  			$filename = $this->path.$file;
                  			
                  			$data['__output__'] = ob_get_contents();
                  			ob_end_clean();
                  	
                  			if(file_exists($filename) && !is_writable($filename)) trigger_error("eroare la scriere", E_USER_ERROR);
                  	
                  			$f = fopen($filename, 'w');
                  			fwrite($f, $this->_pack($data));
                  			fclose($f);
                  			
                  			$this->_output($data['__output__']);
                  			
                  			unset( $this->stack[count($this->stack)-1]);
                  			
                  			return false;
                  		}
                  		elseif( count($this->stack) &&  in_array($file,$this->stack) )
                  		{
                  			trigger_error("eroare la stack: ".$this->stack[count($this->stack)-1], E_USER_ERROR);
                  			exit;
                  		}
                  		else
                  		{
                  			$r = $this->_start($file,$time);
                  			if(is_int($r))
                  			{
                  				return $r;
                  			}
                  			else
                  			{
                  				for($i = 0;$i<count($data); $i++)
                  				{
                  					$data[$i] = $r[$i];
                  				}
                  				return false;
                  			}
                  		}
                  	
                  	}
                  
                  }
                  
                  ?>
                  Wait a few moments for me to find the rest, it was like 5 months ago i did it, and it saved me a shitload of Gigs... Just make step 1 first... Be right back
                  Need cola and chocolate first

                  Get 43 FREE Backlinks when joining SWAG Live - Click my banner to get the links!

                  Comment

                  • Tjeezers
                    Webmaster
                    • Mar 2007
                    • 16604

                    #10
                    Step 2, create a folder called "' cache "" and put it in the root, chmod it to 777
                    So folder name cache, and in 777 please

                    Now i need to find step 3, brb

                    Get 43 FREE Backlinks when joining SWAG Live - Click my banner to get the links!

                    Comment

                    • Tjeezers
                      Webmaster
                      • Mar 2007
                      • 16604

                      #11
                      Step 3 ...

                      Code:
                      <?
                      // CALL THE CACHING CLASS
                      
                      require_once("cache.php");
                      
                      // SET THE CACHING FOLDER PATH
                      
                      $path = "./cache";
                      $self = $_SERVER['PHP_SELF'];
                      $query = !empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null;
                      $file = md5('index');
                      
                      // SET THE EXPIRATION TIME (IN SECONDS)
                      
                      $expire = 3600;
                      $cache = new Cache($path);
                      
                      // START WRITING TO CACHE
                      
                      while($cache->save($file,$expire))
                      
                      {
                      
                      ?>

                      You place this CODE in your index.php

                      variable is $expire = 3600;
                      Higher number, good for high traffic volume
                      Lower Number, good for low traffic volume

                      NOW step 4

                      You place below code above the footer include.

                      Code:
                      <?
                      
                      // FINISH WRITING TO CACHE
                      
                      }
                      
                      ?>
                      This should do the trick

                      You can see the end result on www.SmutThumb.com, as you can see there, the index refreshes every 60 minutes. So the load is way more friendly.
                      This code is costume. It is made to solve the problem you run into now.

                      Kind Regards

                      Harry

                      Get 43 FREE Backlinks when joining SWAG Live - Click my banner to get the links!

                      Comment

                      • d-null
                        . . .
                        • Apr 2007
                        • 13724

                        #12
                        Originally posted by Sex2Have

                        You can see the end result on www.SmutThumb.com, as you can see there, the index refreshes every 60 minutes. So the load is way more friendly.
                        This code is costume. It is made to solve the problem you run into now.

                        Kind Regards

                        Harry

                        nice site Harry, is that the only mod you have done to the TEVs platform on that site? looks like it is running good and I like your php redirect to the sponsor (is that a builtin feature of TEVS)?

                        __________________

                        Looking for a custom TUBE SCRIPT that supports massive traffic, load balancing, billing support, and h264 encoding? Hit up Konrad!
                        Looking for designs for your websites or custom tubesite design? Hit up Zuzana Designs
                        Check out the #1 WordPress SEO Plugin: CyberSEO Suite

                        Comment

                        • Tjeezers
                          Webmaster
                          • Mar 2007
                          • 16604

                          #13
                          Originally posted by d-null
                          nice site Harry, is that the only mod you have done to the TEVs platform on that site? looks like it is running good and I like your php redirect to the sponsor (is that a builtin feature of TEVS)?
                          (is that a builtin feature of TEVS)? = yes
                          is that the only mod you have done to the TEVs platform on that site? = yes

                          The rest on Smut is just some japperdiejapp html work. Nothing impressive to be honest. The only reason i have a TEVS was to have all movies of all my sponsors on 1 place. Gathered 196,000 in 2 months time. Its a bitch to do this a second time....

                          Get 43 FREE Backlinks when joining SWAG Live - Click my banner to get the links!

                          Comment

                          • Gambrinus
                            So Fucking Banned
                            • Jun 2007
                            • 740

                            #14
                            Thanks. But correct me if I am wrong, this is still being created dynamically: http://www.smutthumb.com/video/BrookeSkyecom-269659/ ?

                            My main is static as I am using tgpx to list and rank the thumbs, TEVS to display the video the thumb links to. This is where I am having the trouble. If I sent 100k to dynamically created tevs main with 60 thumbs my box would melt, I solved that problem early with using tgpx to create the main.

                            Comment

                            • Tjeezers
                              Webmaster
                              • Mar 2007
                              • 16604

                              #15
                              you can of course work on the code a little bit and also employ it on the deeper pages. For me the only needed gig chiller was needed on the index. You can also edit the pages and take the side elements out, or lower the amount of pictures you see on your right. If i would make it all static, the visitors would see every time the same related videos when it watches a movie 2 times. As said, when your a little bit handy, the entire TEVS can be made static. For me the need was not there. With TEVS the sponsors host the movies, so i would not be so unhappy to have 100K a day on it, i would optimize the php pages a little here and there, and 100K is easy to handle then. But heee.. im not a coder, i am more a simple webmaster.
                              Last edited by Tjeezers; 11-11-2008, 03:37 PM.

                              Get 43 FREE Backlinks when joining SWAG Live - Click my banner to get the links!

                              Comment

                              • Godsmack
                                Confirmed User
                                • Apr 2004
                                • 4525

                                #16
                                STXT outputs static
                                Download the much improved Free Tube Script adult/mainstream tube solution for FREE!

                                Comment

                                • Gambrinus
                                  So Fucking Banned
                                  • Jun 2007
                                  • 740

                                  #17
                                  Thanks a bunch sex2have, Im gonna dick around with that code and see what happens.

                                  Godsmack, if I cant get that code working you'll most likely be hearing from me shortly.

                                  Comment

                                  • Zorgman
                                    Confirmed User
                                    • Aug 2002
                                    • 6103

                                    #18
                                    I would have made a static version of TEVS but the fact that some webmasters have 200,000 + videos in their database, along with no real template system made me think twice about it.

                                    I would say if the mysql queries are hurting, their is lots of code you can drop.
                                    ---

                                    Comment

                                    • Gambrinus
                                      So Fucking Banned
                                      • Jun 2007
                                      • 740

                                      #19
                                      I just wanted to drop back in here and say after further investigations by host it was determined that a bad mysql config was largely to blame for the crippling load. After being fixed the load isnt a third of what it was. Tits.

                                      Sorry Zorg, didnt want you to think I was in here bagging your script. Im a big fan of it.

                                      Comment

                                      • Zorgman
                                        Confirmed User
                                        • Aug 2002
                                        • 6103

                                        #20
                                        It's cool. Lots of different factors play with server loads.
                                        I had one client back in Feb that was using tevs with 50,000 videos and 20k a day traffic. Told me the script was too slow. After looking at this server there was 500 other domains using tgp and blogs on the same database.

                                        As long as it's fixed, it's all good. :D
                                        ---

                                        Comment

                                        • TDF
                                          Triple OG nigga on GFY
                                          • Mar 2002
                                          • 27296

                                          #21
                                          tevs has excellent support and will help webmasters with the small nuances of the script
                                          Sig heil

                                          Comment

                                          Working...